Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deprecated and Warning during wp core install (wp cli command) #113

Open
SamTyurenkov opened this issue Mar 13, 2024 · 2 comments
Open

Deprecated and Warning during wp core install (wp cli command) #113

SamTyurenkov opened this issue Mar 13, 2024 · 2 comments

Comments

@SamTyurenkov
Copy link

Maybe this is already fixed, didnt test with latest master yet.

WP Version: 6.4.3
PG4WP Version: master downloaded in january 2024

Error:

wp core install --url=https://test.test --title="TEST TEST" --admin_user=admin --admin_password=password [email protected] --allow-root
Deprecated: pg_query(): Automatic fetching of PostgreSQL connection is deprecated in /var/www/site/web/app/pg4wp/driver_pgsql_rewrite.php on line 95
Warning: pg_query(): Query failed: ERROR:  relation "wp_posts_id_seq" does not exist
LINE 1: SELECT SETVAL('wp_posts_ID_seq',(SELECT MAX("ID") FROM wp_po...
                      ^ in /var/www/site/web/app/pg4wp/driver_pgsql_rewrite.php on line 95
sh: 1: /usr/sbin/sendmail: not found
Success: WordPress installed successfully.

Basically wordpress seems to be installed, but there was a Deprecated and Warning.

@mattbucci
Copy link
Collaborator

I haven't tested this yet either tbh but I'm hopeful it was fixed by #101

There's a few bugs in 3.4 to patch though before re-testing deeper, most notably the regex case insensitive change mentioned here: #109 (comment)

@mattbucci
Copy link
Collaborator

mattbucci commented Mar 13, 2024

Deprecated issue still exists, this is a change which can be added to 3.4.1

This line could be changed to pull connection from the global variable, but actually I think this line should not be there

pg_query($GLOBALS['pg4wp_queued_query']);

This is the rewrite class and as such any calls to pg_ should not live here. This seems to be the only such case and is left in by accident.

I think instead maybe this code can be moved to

Maybe wpsqli_query could be recursive so at the bottom it would contain

if(isset($GLOBALS['pg4wp_queued_query'])) {
        $queuedSQL = $GLOBALS['pg4wp_queued_query'];
        unset($GLOBALS['pg4wp_queued_query']);
        wpsqli_query($connection, $queuedSQL, $result_mode);
        pg_query($GLOBALS['pg4wp_queued_query']);
    }
    

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants