Do you have a hook-snippet to add the data to your custom class?
How do you add your custom classes? With a “bootstrap.php” file? With require_once(MODX_CORE_PATH . 'components/classextender/model/ce_autoload.php'); in the hook-snippet?
Hi halftrainedharry, no there is no hook snippet to add a row in the custom table.
Modx users table and my custom table are linked by a composite key, that’s why the row should automatically be created when a new user registers and this row should take default NULL values (default=“NULL”). Only the composite key field “userdata_id” matches the “id” of modx users’ table, but other fields are NULL
In modx 2 it was working without boostrap.
But I will try to include require_once(MODX_CORE_PATH . 'components/classextender/model/ce_autoload.php');
I don’t think that is how a composite relationship works in xPDO.
MODX creates a MODX\Revolution\modUser. The relationship is only defined in your class extendeduser\extUser.
Also the “class” attribute in the composite-relationship of your schema tag seems to be wrong. I think it should be class="extendeduser\userData" instead of class="extendeduser\model\userData".
So when is a new user created on your site? When the snippet “Register” (from the “Login” extra) is executed? Are you sure you don’t run a posthook snippet? Maybe “ExtUserRegisterPosthook” that comes with ClassExtender?
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.