Drag and Drop Image – Error

I have been using the Drag and Drop element and I am running into an issue "Exception - Call to undefined function str_contains()".

This has occured multiple times while using this element and seems to happen when a lot of content is added. For example, the element I am creating has 6 drop zones and 20 text fields that can be dropped into any zone. For this particular example I am also using a background image set to the size of the canvas (900x1200px).

I would love some guideance on what is causing this error, as the 'further information' about the message just takes me here:
https://docs.moodle.org/401/en/error/moodle/generalexceptionmessage

Moodle version: Moodle 4.1.19 (Build: 20250609)

I can see that there are updates available to the Moodle system itself, which I will assume would be recommended before de-bugging.

Content types: 
otacke's picture

That error message does not stem from any specific H5P content type, but from some server-side component, likely H5P core or the H5P integration.

It also tells me that your server is running PHP 7, a version of a programming language that has not been actively supported for 4 years and has not seen security updates in 3 years.

Independently from the problem that you are experiencing, I really recommend you to update your server to a recent version of PHP 8 (8.4 or 8.5). The H5P problem will be resolved along the way.

Thank you for the information on this! I will check with hosting provider on this in that case.

Hopefull this will sort the issue!