ReimuHakurei / phpPgAdmin

Actively maintained fork of phpPgAdmin.
GNU General Public License v2.0
102 stars 24 forks source link

'Deprecated htmlspecialchars(): Passing null' and other problems #16

Closed twistios closed 12 months ago

twistios commented 1 year ago

I followed this tutorial to integrate pgadmin into XAMPP. Using the official pgadmin did not work because of the new version of PHP. I found this issue where this fork was mentioned and tried it.

The original problem had gone away but now I get strange behaviour. The problem seems to be that from PHP 8.1 passing of null to for example htmlspecialchars(php) is deprecated. This is the message I got (it contained some html tags which made it less readable): Deprecated htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated The message got put into multiple fields if they where left empty. This was only visible after clicking on the "change" button. This problem occurrs in many files.

A second problem I got was that I got the message (translated from German):

SQL-Error:
ERROR:  Relation »example.example_id_seq« does not exist

In Querry:
SELECT pg_catalog.has_sequence_privilege('example.example_id_seq', ...

after I clicked on a sequence in my schema. This sequence definetly exists as it works as generator for ids of one of my tables.

Info:

ReimuHakurei commented 1 year ago

What version of PostgreSQL are you connecting to?

twistios commented 1 year ago

The version of PostgreSQL is 16 (currently latest).

ReimuHakurei commented 1 year ago

I have been able to reproduce the htmlspecialchars() issue and will look into resolving this.

I have not been able to reproduce the "Relation »example.example_id_seq« does not exist" issue -- can you provide an example schema dump that causes this problem, or a complete set of instructions to reproduce it?

twistios commented 1 year ago

I was able to reproduce the problem again. It seems like it is related to some kind of case-sensitivity (which was not clear from my example name). I created a sequence ("test_id_seq") with a lower-case name and there was no problem so I thought that I could not find it again (I wanted to reproduce it to write a instruction list). Everything was looking fine. Then I saw that my original sequence contained capital letters so I selected the "change" button for the "test_id_seq" and added a capital letter. The UI said "Sequence changed" but a SQL-Error was shown in a seperate area: grafik

SQL-Error:
ERROR: Relation »public.test_id_seqa« does not exist

In the querry:
SELECT pg_catalog.has_sequence_privilege('public.test_id_seqA','SELECT,USAGE') AS priv...

As can be seen the querry itself uses the right name but the error message uses the lowercase-variant.

ReimuHakurei commented 12 months ago

Try the current master branch I just pushed:

https://github.com/ReimuHakurei/phpPgAdmin/archive/refs/heads/master.zip

This will probably fix these issues.

twistios commented 12 months ago

The problems of this issue seem to be fixed now.