You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a page has a PageTable field and it's joined with e.g. $pages->get($selector, ['loadOptions' => ['joinFields' => ['c_ref']]]) or $pages->find($selector, ['loadOptions' => ['joinFields' => ['c_ref']]]) (as opposed to id=123, field=c_ref), the resulting $p->c_ref is empty when the field contains more than one page.
Expected behavior
Adding joinFields should not affect the result, only performance.
Actual behavior
If there are more than one subpage, they are not fetched.
Screenshots/Links that demonstrate the issue
Possible cause: PageValues.php tries to explode the value, but only does it if the GROUP_CONCAT separator is seen in the results.
I believe the correct way to fix this would be to avoid searching for separators in the string, and instead make sure that we always explode after GROUP_CONCAT. But it seems to me that instead we could just change the earlier FieldtypePageTable.php fix like this:
NB: this is closely related to #1988
Short description of the issue
When a page has a PageTable field and it's joined with e.g.
$pages->get($selector, ['loadOptions' => ['joinFields' => ['c_ref']]])
or$pages->find($selector, ['loadOptions' => ['joinFields' => ['c_ref']]])
(as opposed toid=123, field=c_ref
), the resulting$p->c_ref
is empty when the field contains more than one page.Expected behavior
Adding
joinFields
should not affect the result, only performance.Actual behavior
If there are more than one subpage, they are not fetched.
Screenshots/Links that demonstrate the issue
Possible cause: PageValues.php tries to
explode
the value, but only does it if theGROUP_CONCAT
separator is seen in the results.Issue #1988 was fixed by making sure that
$value
is an array.I believe the correct way to fix this would be to avoid searching for separators in the string, and instead make sure that we always
explode
afterGROUP_CONCAT
. But it seems to me that instead we could just change the earlierFieldtypePageTable.php
fix like this:Steps to reproduce the issue
The script below creates a parent and child template,
p
andc
, and a fieldc_ref
in thep
template. Then it adds these pages:If run without GET params, it fetches all the pages and prints the above output. If run with
?join
, only the lone childchild-b1
is printed.Setup/Environment
The script:
The text was updated successfully, but these errors were encountered: