Non-core contributed modules

Presentation Module: Insert slide fails and deletes subsequent slides

Details

  • Type: Bug Bug
  • Status: Open Open
  • Priority: Blocker Blocker
  • Resolution: Unresolved
  • Affects Version/s: 1.8.1
  • Fix Version/s: None
  • Labels:
    None
  • Environment:
    PHP 4.4, Moodle 1.8x
  • Database:
    MySQL
  • Affected Branches:
    MOODLE_18_STABLE

Description

(1)PRESENTATION module doesn't install in Moodle 1.8x unless:
We changed presentation/db/mysql.sql by adding a null parameter as the first parameter on the inserts.

(2) CRITICAL: in lib.php, there is a loop that goes thru all the slides when you've inserted one, adding them to the database. But if the insert record fails, the loop stops and all subsequent slides are lost. This happens unpredictably and often, making the PRESENTATION module almost useless.

In lib.php:
In reordering slides, when an error occurred, all slides after the error were not preserved. – still don't why it is happening.

foreach $slides as $slide ....
if(!insert_record("presentation_slides", $slide_instance)){
error("ERROR :: Could not Update Presentation Slide" . $slide->id . "lib.php.");

If this fails, all the rest of the slides are lost.

Activity

Hide
Sandra Combs added a comment -

I think the insert_record fails if the content of the slide contains a single quote; because the HTML code for the content is enclosed in single quotes, a single quote in the text causes MySQL to reject the content and the slide does not get inserted. Because of the way the error was handled, all the subsequent slides were not inserted either, so you have a great loss of data if you try to insert a slide with such content into the middle of a large number of slides.

Show
Sandra Combs added a comment - I think the insert_record fails if the content of the slide contains a single quote; because the HTML code for the content is enclosed in single quotes, a single quote in the text causes MySQL to reject the content and the slide does not get inserted. Because of the way the error was handled, all the subsequent slides were not inserted either, so you have a great loss of data if you try to insert a slide with such content into the middle of a large number of slides.

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated: