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

Coding error with conditional access based on user profile field: Requested user profile field does not exist

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      Test pre-requisites

      1. Set $CFG->cachetext = 0;
      2. Enable enableavailability
      3. Add all the possible items to frontpage (list of courses, list of categories, etc...)
      4. Add any activity on the front page with Restrict access set to User field AIM ID is not empty
      5. Add an assignment to any course with Restrict access set to User field AIM ID is not empty
        • Copy its URL for future reference

      Test steps

      1. Go on the front page, and logout entirely (not even as guest)
      2. Make sure you don't experience any error on the front page
      3. Wait 2 minutes, and make sure there still is no error
      4. Login as admin, and delete the activity on the front page
      5. Logout and visit the front page again
      6. Make sure you don't experience any error on the front page
      7. Wait 2 minutes, and make sure there still is no error
      8. Directly access the assigmnent using its URL
      9. Make sure you're redirected to the login page
      Show
      Test pre-requisites Set $CFG->cachetext = 0; Enable enableavailability Add all the possible items to frontpage (list of courses, list of categories, etc...) Add any activity on the front page with Restrict access set to User field AIM ID is not empty Add an assignment to any course with Restrict access set to User field AIM ID is not empty Copy its URL for future reference Test steps Go on the front page, and logout entirely (not even as guest) Make sure you don't experience any error on the front page Wait 2 minutes, and make sure there still is no error Login as admin, and delete the activity on the front page Logout and visit the front page again Make sure you don't experience any error on the front page Wait 2 minutes, and make sure there still is no error Directly access the assigmnent using its URL Make sure you're redirected to the login page
    • Affected Branches:
      MOODLE_24_STABLE
    • Fixed Branches:
      MOODLE_24_STABLE
    • Pull from Repository:
    • Pull Master Branch:
      MDL-38289-master-int

      Description

      I have bumped into this in live course when trying to follow assignment links from e-mail notifications when not logged in Moodle.

      I can reproduce this error on qa.moodle.net.

      Steps to reproduce:

      1. Set intro section 0 to conditional access: "Not available if your aim is empty"
      2. Add assignment to course section 1.
      3. Log off and click on direct link to assignment created in step 2. (ie. http://qa.moodle.net/mod/assign/view.php?id=281)

      I get this error:

      Requested user profile field does not exist
       
      Debug info:
      Error code: codingerror
      Stack trace:
       
          line 1345 of /lib/conditionlib.php: coding_exception thrown
          line 1039 of /lib/conditionlib.php: call to condition_info_base->get_cached_user_profile_field()
          line 280 of /lib/conditionlib.php: call to condition_info_base->is_available()
          line 1744 of /lib/modinfolib.php: call to condition_info_section->is_available()
          line 337 of /lib/modinfolib.php: call to section_info->__construct()
          line 1393 of /lib/modinfolib.php: call to course_modinfo->__construct()
          line 2838 of /lib/moodlelib.php: call to get_fast_modinfo()
          line 39 of /mod/assign/view.php: call to require_login()
      

      What I expect: login form with redirection to assignment after successful login

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                1 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  13/May/13