Uploaded image for project: 'Plugins'
  1. Plugins
  2. CONTRIB-1008

[PATCH] If get all the users that have certificates issued returns empty list a warning is thrown

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Won't Fix
    • Affects Version/s: 1.9.4
    • Fix Version/s: None
    • Component/s: Module: Certificate
    • Labels:
      None
    • Affected Branches:
      MOODLE_19_STABLE

      Description

      Warning: Invalid argument supplied for foreach() in /mod/certificate/lib.php on line 524

      Patch

      Index: lib.php
      ===================================================================
      RCS file: /cvsroot/moodle/contrib/plugins/mod/certificate/lib.php,v
      retrieving revision 1.25
      diff -u -r1.25 lib.php
      — lib.php 14 Nov 2008 01:30:20 -0000 1.25
      +++ lib.php 2 Feb 2009 16:39:55 -0000
      @@ -520,9 +520,11 @@
      AND s.certdate > 0
      ORDER BY $sort");
      //now exclude all the certmanagers.

      • foreach ($users as $id=>$user) {
      • if (isset($certmanagers[$id])) { //exclude certmanagers.
      • unset($users[$id]);
        + if (!empty($users)) {
        + foreach ($users as $id=>$user)
        Unknown macro: {+ if (isset($certmanagers[$id])) { //exclude certmanagers. + unset($users[$id]); + } }

        }

        Attachments

          Activity

            People

            Assignee:
            markn Mark Nelson
            Reporter:
            urshunkler Urs Hunkler
            Participants:
            Component watchers:
            Mark Nelson
            Votes:
            2 Vote for this issue
            Watchers:
            0 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: