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

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

XMLWordPrintable

    • Any
    • MOODLE_18_STABLE, MOODLE_19_STABLE
    • MOODLE_18_STABLE, MOODLE_19_STABLE

      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.

            skodak Petr Skoda
            roal Robert Allerstorfer
            Eloy Lafuente (stronk7) Eloy Lafuente (stronk7)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved:

                Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.