Skip to content

Bug with getDocumentChildren() and getAllChildren() in version 3.1.10 #2089

@q2apro

Description

@q2apro

When I use this query:

$children = $modx->getDocumentChildren($docid, 1, 0, 'id, pagetitle, description, alias, parent', '', 'pagetitle', 'ASC');

I get the error:

« Evolution CMS Parse Error »
SQLSTATE[42S22]: Column not found: 1054 Unknown column ' pagetitle' in 'field list' (SQL: select `id`, ` pagetitle`, ` description`, ` alias`, ` parent` from `modx_site_content` where `modx_site_content`.`parent` = 11 and `modx_site_content`.`published` = 1 and `modx_site_content`.`deleted` = 0 and `privatemgr` = 0 and `modx_site_content`.`deletedon` = 0 order by `pagetitle` asc)

File /core/vendor/illuminate/database/Connection.php
Line 712

But the column pagetitle is in the database!

It seems that there is a whitespace before the '_pagetitle'.


What I did before: I copied one EvoCMS instance to a new server. The old server processes the query fine, the new server crashes with the error message.

Same error with:

$childrendocs = $modx->getDocumentChildren($parentid, 1, 0, 'id, pagetitle, description, alias, parent, content', '', 'alias + 0', 'ASC');

« Evolution CMS Parse Error »
SQLSTATE[42S22]: Column not found: 1054 Unknown column ' pagetitle' in 'field list' (SQL: select `id`, ` pagetitle`, ` description`, ` alias`, ` parent`, ` content` from `modx_site_content` where `modx_site_content`.`parent` = 71 and `modx_site_content`.`published` = 1 and `modx_site_content`.`deleted` = 0 and `privatemgr` = 0 and `modx_site_content`.`deletedon` = 0 order by `alias + 0` asc)

I also updated to EVO CMS 3.1.10. Could this be the problem?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions