akeeba / panopticon

Self-hosted site monitoring and management

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Adding notes doesn't work properly

morphinestyle opened this issue · comments

Due diligence

  • I have searched all open and closed issues for this problem.
  • I have searched all open and closed discussions for this problem.
  • I have looked at the CHANGELOG to make sure this problem has not already been addressed.
  • I agree to the Code of Conduct of this repository

Describe the bug

Adding notes to a website does not work correctly: the note is not displayed anywhere and when refreshing (save or save and close) the page, the note does not remain stored.

Reproduction instructions

Add a note to a website
Click Save or Save and Close

Expected behaviour

The note remains stored on the entry page.
The note can be viewed somewhere/somehow in the websites dashboard.

Actual behaviour

The note disappeared in the entry page.
The note is not visible anywhere else.

Screenshots

No response

Panopticon version

1.1.0

PHP version

8.2

Database type

MariaDB

Database version

10.11

Browser

None

Browser version

No response

Additional information

No response

I just added this note just fine

image

Notes are only displayed at the bottom of the Site Information page. They are not displayed in the Sites Overview (tabular or dashboard) views.

Remember that the green button with the arrows to the right of the Notes card is a collapse / expand button. Is it possible you have collapsed the notes, which is why you do not see them?

Short comment - same here. Already after click on SAVE the information is deleted. Was already so with pan 1.07. Of course I have currently no use case for a note it is not important for me. Only guessing - cut it be, that a necessary table was not created with updates of panopticon?
notes-save

Fairly certain that your problem is that your db has not been updated to support the notes feature.

See

<action table="#__sites" canfail="1">
<condition type="missing">notes</condition>
<query><![CDATA[
ALTER TABLE `#__sites` ADD COLUMN `notes` LONGTEXT NULL AFTER `config`;
]]></query>
</action>
<action table="#__sites" canfail="1">
<condition type="index" operator="not"><![CDATA[#__sites_name]]></condition>
<query><![CDATA[
ALTER TABLE `#__sites`
ADD INDEX `#__sites_name` (`name`(50));
]]></query>
</action>

@Rolli1962 If your database is not updated you should be able to go to Panopticon, Administration, Update Panopticon and click on the "Run the Post-upgrade Code" button.

Have click on "Run the Post-upgrade Code" button. No change. Did a look on the database - the column is not there. Attached the columns of my table sites.
sites-column

Have entered the SQL-Statement manually in the DB. After this notes is working. For whatever reason it is not done via Post-upgade Code... SQL-Statement:
ALTER TABLE pnptc_sites ADD COLUMN notes LONGTEXT NULL AFTER config;

We have been using this database updater code for 11 years (since Akeeba Backup for WordPress was released back in 2013 – yes, that was eleven years ago, I am as shocked as you are). The same code was also used on FOF 3 and 4 i.e. between 2014 and 2021 for all of our Joomla! software.

There has been exactly one reason I have ever seen this fail. Your database user does not have the privilege to run SHOW COLUMNS against the tables. Can you please check the privileges of your database user for the Panopticon database? Hint: on phpMyAdmin there's a user management link towards the top right of the main page.

These are the privileges:

image

And I am to stupid to find settings for the rights in my phpmyadmin. It seems here do exist only one user with all rights. Even if I take a look on the versions - as least the PHP-version is not really up-to-date. It shows:
lighttpd/1.4.55
Datenbank-Client Version: libmysql - mysqlnd 7.4.3-4ubuntu2.18
PHP-Erweiterung: mysqli Dokumentation curl Dokumentation mbstring Dokumentation
PHP-Version: 7.4.3-4ubuntu2.18

If you’re on a commercial hosting company eg one using cPanel the user management in phpMyAdmin is disabled. You’ll have to do that in the hosting control panel instead.

Yes, but there it is only possible to set one User with password - and not to see or set any kind of rights.

To save everyones time could you please ask your host if the user has the privilege to run SHOW COLUMNS

To save everyones time could you please ask your host if the user has the privilege to run SHOW COLUMNS

Have asked my provider. They want to have a error message or equal. Cause I do not have such, I gave the link to this issue.

To save everyones time could you please ask your host if the user has the privilege to run SHOW COLUMNS

Have gotten the info below from my provider (written in German).
Was not really the answer of my question, but I opened the mysql-prompt as described.
Details of user / db name here replaced with XXX

mysql> SELECT user,host FROM mysql.user;
ERROR 1142 (42000): SELECT command denied to user 'sXXXXXX_XXXXXXX'@'sh16-62.1blu.de' for table 'user'
Remark: My interpretation: It is not allowed for my to display the user. But it seems there is only one configured.

mysql> SHOW GRANTS;
+-----------------------------------------------------------------------+
| Grants for sXXXXXX_XXXXXXX@% |
+-----------------------------------------------------------------------+
| GRANT USAGE ON . TO sXXXXXX_XXXXXXX@% |
| GRANT ALL PRIVILEGES ON dbXXXXXXxXXXXXXX.* TO sXXXXXX_XXXXXXX@% |
+-----------------------------------------------------------------------+
Remark: But it is allowed to see my own rights. With the same user panopticon is doing the connection.

mysql> show full columns from pnptc_sites;
+-------------+------------------+--------------------+------+-----+-------------------+-------------------+---------------------------------+---------+ | Field | Type | Collation | Null | Key | Default | Extra | Privileges | Comment | +-------------+------------------+--------------------+------+-----+-------------------+-------------------+---------------------------------+---------+ | id | bigint unsigned | NULL | NO | PRI | NULL | auto_increment | select,insert,update,references | | | name | varchar(255) | utf8mb4_unicode_ci | NO | MUL | NULL | | select,insert,update,references | | | url | varchar(1024) | utf8mb4_unicode_ci | NO | | NULL | | select,insert,update,references | | | enabled | tinyint unsigned | NULL | NO | | 1 | | select,insert,update,references | | | created_on | datetime | NULL | NO | | CURRENT_TIMESTAMP | DEFAULT_GENERATED | select,insert,update,references | | | created_by | bigint unsigned | NULL | NO | MUL | NULL | | select,insert,update,references | | | modified_on | datetime | NULL | YES | | NULL | | select,insert,update,references | | | modified_by | bigint unsigned | NULL | YES | MUL | NULL | | select,insert,update,references | | | locked_on | datetime | NULL | YES | | NULL | | select,insert,update,references | | | locked_by | bigint unsigned | NULL | YES | MUL | NULL | | select,insert,update,references | | | config | json | NULL | YES | | NULL | | select,insert,update,references | | | notes | longtext | utf8mb4_unicode_ci | YES | | NULL | | select,insert,update,references | | +-------------+------------------+--------------------+------+-----+-------------------+-------------------+---------------------------------+---------+
Remark: As least via the mysql-prompt it is alowed to show. Column notes was added by myself manually.

Original answer of my provider (German):
Sie können die Berechtigungen via SSH einsehen. Dazu loggen Sie sich mit dem SSH-Zugang
https://faq.1blu.de/solution_id_1067.html
auf Ihren Webspace ein und geben ein
mysql -h DB_HOST -u DB_USER -p DB_NAME
Dann können Sie sich die Berechtigungen einer Tabelle etwa mit
show full columns from TBL_NAME;
anzeigen lassen. Die Dokumentation finden Sie unter
https://dev.mysql.com/doc/refman/8.0/en/show-columns.html

I don't know what to tell you. It has worked for literally everyone else the last 11+ years. As I said, the database update code has been in use since 2013, and it was the way all of our standalone, WordPress, and Joomla! products updated the database until 2021 – and the only way all of our standalone and WordPress products update their database still.