Moodle

Long location when adding a link resource causes SQL error

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 1.9
  • Fix Version/s: 1.9.5
  • Component/s: Resource
  • Labels:
    None
  • Database:
    Oracle
  • Affected Branches:
    MOODLE_19_STABLE
  • Fixed Branches:
    MOODLE_19_STABLE

Description

If a user enters a string larger than 255 chars into the 'Location' field when adding a new file/url resource, Oracle throws an error about the value being too large for the column. I've worked around this with the attached patch.

Issue Links

Activity

Hide
Eloy Lafuente (stronk7) added a comment - - edited

Hi Jonathon,

I've just fulfilled MDL-13855 about to discuss and apply a general solution for this problem.

IMO, just truncating the data isn't the best solution. We should specify max lenghts and validate them properly to be really consistent.

Thanks for your report. It's has ignited the other one. Ciao

Show
Eloy Lafuente (stronk7) added a comment - - edited Hi Jonathon, I've just fulfilled MDL-13855 about to discuss and apply a general solution for this problem. IMO, just truncating the data isn't the best solution. We should specify max lenghts and validate them properly to be really consistent. Thanks for your report. It's has ignited the other one. Ciao
Hide
Eloy Lafuente (stronk7) added a comment -

Resolving as fixed both in 19_STABLE and HEAD.

Now the field specification allow "maxlength" attribute + one rule has been added to enforce it.

Show
Eloy Lafuente (stronk7) added a comment - Resolving as fixed both in 19_STABLE and HEAD. Now the field specification allow "maxlength" attribute + one rule has been added to enforce it.
Hide
Sam Hemelryk added a comment -

Tested and ok, thanks

Show
Sam Hemelryk added a comment - Tested and ok, thanks

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: