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

Quotes mismatch leads to print "$cid" instead of the value of $cid

    Details

    • Database:
      Any
    • Affected Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE
    • Fixed Branches:
      MOODLE_18_STABLE, MOODLE_19_STABLE

      Description

      While trying to fix MDL-14336 I came across nasty code within mod/data/lib.php that uses a mismatch of single and double quotes like this:

      echo '<option value="$cid">'.$currentfield->name.'</option>';

      which led not to solve $cid into its value, but printing out "$cid" to the HTML source instead. I have cleaned up the whole quotes related code within if (!empty($currentfields) && !empty($newfields)) { } and also added linebreaks after option tags to prevent making kilometers long lines of HTML code. Now the resulting table also displays properly, previously it got cut down somehow.

        Gliffy Diagrams

        1. MDL-14342.patch
          3 kB
          Robert Allerstorfer

          Issue Links

            Activity

            roal Robert Allerstorfer created issue -
            Hide
            roal Robert Allerstorfer added a comment -

            Here is the patch against MOODLE_19_STABLE. Should be committed asap, since the current code CAN'T work.

            Show
            roal Robert Allerstorfer added a comment - Here is the patch against MOODLE_19_STABLE. Should be committed asap, since the current code CAN'T work.
            roal Robert Allerstorfer made changes -
            Field Original Value New Value
            Attachment MDL-14342.patch [ 13633 ]
            skodak Petr Skoda made changes -
            Priority Blocker [ 1 ] Major [ 3 ]
            skodak Petr Skoda made changes -
            Assignee Martin Dougiamas [ dougiamas ] Petr Skoda [ skodak ]
            Hide
            skodak Petr Skoda added a comment -

            found one more in new preset class, thanks for the report and patch

            Show
            skodak Petr Skoda added a comment - found one more in new preset class, thanks for the report and patch
            skodak Petr Skoda made changes -
            Status Open [ 1 ] Resolved [ 5 ]
            Fix Version/s 1.8.6 [ 10270 ]
            Fix Version/s 1.9.1 [ 10240 ]
            Resolution Fixed [ 1 ]
            Hide
            roal Robert Allerstorfer added a comment -

            Thank you for committing, Petr! With this bug having fixed, I was now also able to fix bug MDL-14336

            Show
            roal Robert Allerstorfer added a comment - Thank you for committing, Petr! With this bug having fixed, I was now also able to fix bug MDL-14336
            Hide
            stronk7 Eloy Lafuente (stronk7) added a comment -

            Verified, closing. Thanks!

            Show
            stronk7 Eloy Lafuente (stronk7) added a comment - Verified, closing. Thanks!
            stronk7 Eloy Lafuente (stronk7) made changes -
            Status Resolved [ 5 ] Closed [ 6 ]
            stronk7 Eloy Lafuente (stronk7) made changes -
            QA Assignee stronk7
            Hide
            roal Robert Allerstorfer added a comment -

            Petr,

            I noticed that your change of mod/data/lib.php in HEAD (http://cvs.moodle.org/moodle/mod/data/lib.php?r1=1.151&r2=1.152) was not limited to the reported problem. In addition, you reverted Dongsheng's commit http://cvs.moodle.org/moodle/mod/data/lib.php?r1=1.146&r2=1.147 as part of MDL-14129. Could you please explain?

            Thanks.

            Show
            roal Robert Allerstorfer added a comment - Petr, I noticed that your change of mod/data/lib.php in HEAD ( http://cvs.moodle.org/moodle/mod/data/lib.php?r1=1.151&r2=1.152 ) was not limited to the reported problem. In addition, you reverted Dongsheng's commit http://cvs.moodle.org/moodle/mod/data/lib.php?r1=1.146&r2=1.147 as part of MDL-14129 . Could you please explain? Thanks.
            roal Robert Allerstorfer made changes -
            Link This issue has been marked as being related by MDL-14129 [ MDL-14129 ]
            Hide
            dongsheng Dongsheng Cai added a comment -

            Fixed, no worries

            Show
            dongsheng Dongsheng Cai added a comment - Fixed, no worries
            dougiamas Martin Dougiamas made changes -
            Workflow jira [ 25908 ] MDL Workflow [ 59462 ]
            dougiamas Martin Dougiamas made changes -
            Workflow MDL Workflow [ 59462 ] MDL Full Workflow [ 88613 ]

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  15/May/08