donhinkelman / moodle-block_sharing_cart

Content sharing plug-in for Moodle LMS. Now at version 4.4, release 3 (actually this is for Moodle LMS version 4.3. Requires PHP 7.4.
7 stars 38 forks source link

Bug with REMUI theme: Coping section to Sharing Cart throw exception #34

Closed YogevBokobza closed 4 years ago

YogevBokobza commented 4 years ago

Hi,

I'm having problem with Sharing Cart and REMUI theme. When I'm trying to copy complete section to Sharing Cart I get exception (picture attached). The exception says that "A required parameter (sectionid) was missing".

I found the reason for that. I saw that you are trying to get the sectionid by searching the HTML looking for h3 title. However, In REMUI theme (at least in my current version which is: 3.7.3) they use h4 for title. So Sharing Cart can't find sectionid and exception is thrown.

Possible fix I found: In file: blocks/sharing_cart/script.js In line: 1141 Change from:var sectionID = $(this).find("div.content h3.sectionname span.inplaceeditable").attr("data-itemid"); To:var sectionID = $(this).find("div.content .sectionname span.inplaceeditable").attr("data-itemid");

Mainly fix is that to remove h3 reference and leave just .sectionname class.

This fix also can solve the problem in other themes (if there any).

thanks, Yogev.

pic

DKSteffensen commented 4 years ago

Hey,

We are working with this in Praxis, and would like to know which versions you are using. Please tell us your: REMUI version, MOODLE version and most important sharing_cart version.

The code you posted, is not the same as seen in the master branch, so maybe the issue has been resolved?

Please provide us with as much information, and we will look into it.

DKSteffensen commented 4 years ago

Just want to follow up on this, and hear if you still got this issue? @YogevBokobza

Mikkeljeppesen1 commented 4 years ago

@donhinkelman

Can you close this one - we solved it a long time ago

donhinkelman commented 4 years ago

Thank you for taking care of this before.