[wp-trac] [WordPress Trac] #41171: Incorrect (query?) fetching of Pages

WordPress Trac noreply at wordpress.org
Sun Jun 25 22:16:31 UTC 2017


#41171: Incorrect (query?) fetching of Pages
--------------------------+-----------------------------
 Reporter:  hyperized     |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  General       |    Version:  4.8
 Severity:  normal        |   Keywords:
  Focuses:                |
--------------------------+-----------------------------
 So, this occurs on 4.8 and 4.7 (even down to 3.x) alike, so it's most
 likely a compatibility bug between the versions of software in use and
 Wordpress. Versions are listed below.

 The effects are pretty bad as I can no longer open Posts ('Invalid post
 type.') and no longer use Pages ('No pages found') however there are three
 items correctly listed in the 'All' count on Pages, so the count queries
 work correctly.

 I tried figuring out what happens, but I have not managed to nail it down
 to the exact error. I also tried Googling this issue and the 'fixes' did
 not go beyond: nail this down to a plugin. I can reproduce this error with
 each clean install (no plugins, nothing beyond the default theme) over and
 over again, so that's not going to fix it.

 To fetch the content of 'Pages' the following query is executed (courtesy
 of Query Monitor):

 {{{
 SELECT wp_posts.*
 FROM wp_posts
 WHERE 1=1
 AND wp_posts.post_name = 'edit-php'
 AND wp_posts.post_type = 'page'
 ORDER BY wp_posts.post_title ASC
 }}}

 Which is odd since no pages have the name edit-php.
 This explains why it shows 'No Pages found', the query returns none.

 The page however itself is called edit.php. I'm supposing something is
 going wrong with the query input here. It seems mixed up.

 I'm at the same time provided with a (because of debug on):

 {{{
 Notice: Undefined offset: 1 in /home/mydomain/public_html/wp-
 includes/vars.php on line 31
 }}}

 This file relies on {{{ $_SERVER['PHP_SELF'] }}} to obtain the page
 information. If I slip in a {{{ phpinfo() }}} in the line above the 'if'
 to assert wheter it's filled with the correct information I get: {{{
 $_SERVER['PHP_SELF']  /edit.php }}}. This seems correct, so it's kind of
 odd that {{{ offset 1 is undefined }}} on {{{ $self_matches }}}.

 When debugging {{{ $self_matches }}} on line 31, I get: {{{ array(0) { }
 }}}.

 Server environment as reported by Query Monitor:
 {{{
 PHP
 Property        Value
 version 7.0.19
 sapi    fpm-fcgi
 user    wantsone
 max_execution_time      30
 memory_limit    1G
 upload_max_filesize     64M
 post_max_size   64M
 }}}

 {{{
 Database
 Property        Value
 extension       mysqli
 server version  5.5.5
 client version  50012 (5.0.12)
 user    mysite_wp1
 host    localhost
 database        mysite_wp1
 key_buffer_size 134217728
 ~128 MB
 max_allowed_packet      4194304
 ~4 MB
 max_connections 151
 query_cache_limit       1048576
 ~1 MB
 query_cache_size        1048576
 ~1 MB
 query_cache_type        OFF (Help)
 }}}
 Database is in fact: {{{ MariaDB 10.1.24 }}}

 {{{
 WordPress
 Property        Value
 version 4.8
 WP_DEBUG        true
 WP_DEBUG_DISPLAY        true
 WP_DEBUG_LOG    false
 SCRIPT_DEBUG    false
 WP_CACHE        false
 CONCATENATE_SCRIPTS     undefined
 COMPRESS_SCRIPTS        undefined
 COMPRESS_CSS    undefined
 WP_LOCAL_DEV    undefined
 }}}

 {{{
 Server
 Property        Value
 software        Apache
 version 2
 }}}
 Apache is in fact: {{{ Server version: Apache/2.4.26 (Unix) }}} {{{ 64bit
 MPM event }}}

--
Ticket URL: <https://core.trac.wordpress.org/ticket/41171>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list