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
I get this PHP warning when i try to save an object that uses a compound primary key:
(ERROR @ .../core/xpdo/om/xpdoobject.class.php : 1478) PHP warning: Illegal offset type
The warning is produced in modx 2.6.0 running om PHP 7.1.13.
The code line that is referenced (https://github.com/modxcms/xpdo/blob/2.5.x/xpdo/om/xpdoobject.class.php#L1478) uses the result from getPK() as an array index but since getPK() in this case returns an array that produces the warning. The save method should be changed so that it can handle compund keys as well but I don't know the best way to do it.
My code works in that way that the object is saved to the database correctly.
The text was updated successfully, but these errors were encountered:
Thanks for the issue. xPDO can handle compound keys, but the problem here is I never anticipated a case where a compound key would include an auto_increment value. I'll have to refactor the code there to handle this kind of situation.
I get this PHP warning when i try to save an object that uses a compound primary key:
(ERROR @ .../core/xpdo/om/xpdoobject.class.php : 1478) PHP warning: Illegal offset type
The warning is produced in modx 2.6.0 running om PHP 7.1.13.
I have a minimal table that uses this schema:
Here is an image showing the table structure in phpMyAdmin:
The modx snippet code that produces the warning is:
The code line that is referenced (https://github.com/modxcms/xpdo/blob/2.5.x/xpdo/om/xpdoobject.class.php#L1478) uses the result from
getPK()
as an array index but sincegetPK()
in this case returns an array that produces the warning. The save method should be changed so that it can handle compund keys as well but I don't know the best way to do it.My code works in that way that the object is saved to the database correctly.
The text was updated successfully, but these errors were encountered: