Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Event is null - error/moodle/dmlwriteexception #200

Open
TopSolid-DaA opened this issue Mar 20, 2023 · 6 comments
Open

Event is null - error/moodle/dmlwriteexception #200

TopSolid-DaA opened this issue Mar 20, 2023 · 6 comments

Comments

@TopSolid-DaA
Copy link

Hi

I run this bug when trying to select an event to monitor. I use Moodle 3.9 with Intellicart plugin. It happens only with Intellicart events.

Info de débogage Column 'event' cannot be null
INSERT INTO mdl_tool_trigger_workflows (name,description,event,enabled,realtime,debug,draft,timecreated,timemodified,timetriggered) VALUES(?,?,?,?,?,?,?,?,?,?)
[array (
0 => 'Intellicart',
1 => '{"text":"<p dir=\"ltr\" style=\"text-align: left;\">Intellicart<\/p>","format":"1"}',
2 => NULL,
3 => 1,
4 => 1,
5 => 1,
6 => 0,
7 => 1679302361,
8 => 1679302361,
9 => 0,
)]
Error code: dmlwriteexception

Notice: Undefined property: stdClass::$eventtomonitor in htdocs/admin/tool/trigger/classes/workflow_process.php on line 200

How to fix that?

@danmarsden
Copy link
Member

I would guess this is a problem with the intellicart plugin not triggering events correctly. Not sure we can help much here as I don't believe the intellicart code is avaialble publicly for us to see anywhere and we don't use intellicart ourselves.

@TopSolid-DaA
Copy link
Author

Thanks @danmarsden. I have reported your guess to Intellicart dev for further investigation.

@arina-mish
Copy link

Hi @danmarsden

Let me jump here from IntelliCart side to help with issue resolution.

We have re-checked both plugins, and our dev team found the next thing missed in tool_trigger plugin:

Moodle requires to use setType(). And there is not setType() for event field: https://github.com/catalyst/moodle-tool_trigger/blob/MOODLE_311_STABLE/classes/edit_form.php
image
Therefore, it allows to save only events with small name, which is not working for IntelliCart Events, 'cause we have pretty long names (e.g., "IntelliCart: IntelliCart product checkout").

Please, check the plugin on your side for this note.

@TopSolid-DaA
Copy link
Author

Thank you @arina-mish for the analysis.
So I have added this line at 90:

$mform->setType('eventtomonitor', PARAM_TEXT);

and saving the event seems to work now ;-)
@danmarsden Can you test on your side if this fix would be OK for you?

@danmarsden
Copy link
Member

Great - thanks for providing that further information! - feel free to submit a pull request for us to review otherwise this may sit here for a while until someone comes back to it.

thanks!

@TopSolid-DaA
Copy link
Author

Thanks @danmarsden!
Pull request has been created as requested. Please check it, I am not sure if it is correct.
#201

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants