Jump to content

Bug? PageReference list with content not updated with $page->myField= $pageIdArray


da²
 Share

Recommended Posts

Hi,

A script is updating a PageReference field that can contain multiple pages. It works when field is empty, but I just found the already filled field is not saving changes.

$classPageIds = [16988];

echo($page->carClasses); // [16569, 16988]
$page->carClasses = $classPageIds;
echo($page->carClasses); // [16569, 16988] NO CHANGES

So I have to remove all items before:

$page->carClasses->removeAll();
$page->carClasses = $classPageIds;

 

That looks like a bug but I'm asking before to report an issue, in case I'm doing this the wrong way.

 

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...