Uploaded image for project: 'Moodle'
  1. Moodle
  2. MDL-70941

Cannot rename content bank item to "0"

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 3.9.4, 3.10.1, 3.11, 4.0
    • Fix Version/s: 3.9.5, 3.10.2
    • Component/s: Content bank
    • Labels:

      Description

      Create a content bank item with a name such as "Cool bananas", view it and from the "Actions menu" press "Rename"

      Try to rename to: "0" (just the number zero without any quotes)

      You receive the error message "Empty name is not allowed" and the item is not renamed

      It fails because this empty check doesn't work for strings (PHP considers the string "0" to be empty) - similar change in core_contenbank\content\set_name() probably required too

      David Matamoros and I found while he was looking at MDL-70910

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              davidmatamoros David Matamoros
              Reporter:
              pholden Paul Holden
              Peer reviewer:
              Amaia Anabitarte
              Integrator:
              Eloy Lafuente (stronk7)
              Tester:
              Anna Carissa Sadia
              Participants:
              Component watchers:
              Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Fix Release Date:
                8/Mar/21

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 1 hour, 35 minutes
                  1h 35m