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

questionid_column_name and extra_answer_fields should be public to allow access from backup and restore classes

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.1.3, 2.2
    • Fix Version/s: 2.2.1, 2.3
    • Component/s: Questions
    • Labels:
    • Testing Instructions:
      Hide

      I really coudn't imagine what could go wrong from making previously protected method public. Thought you must be sure it is public in all subclasses (i.e. shortanswer in core). In my experience having public/protected mismatch leads to empty screen on previewing questions (or fatal error depending on you error-reporting level).

      So just run preview of one question of each core types in Moodle if you want to be extra sure. If a question is able to display itself, all is OK.

      Show
      I really coudn't imagine what could go wrong from making previously protected method public. Thought you must be sure it is public in all subclasses (i.e. shortanswer in core). In my experience having public/protected mismatch leads to empty screen on previewing questions (or fatal error depending on you error-reporting level). So just run preview of one question of each core types in Moodle if you want to be extra sure. If a question is able to display itself, all is OK.
    • Workaround:
      Hide

      No one possible without hacking PHP, so better have this fixed in all 2.x

      Show
      No one possible without hacking PHP, so better have this fixed in all 2.x
    • Affected Branches:
      MOODLE_21_STABLE, MOODLE_22_STABLE
    • Fixed Branches:
      MOODLE_22_STABLE, MOODLE_23_STABLE
    • Pull from Repository:
    • Pull Master Branch:

      Description

      In Moodle 1.x backup/restore of question was handled by question type class, so having questionid_column_name() and extra_answer_fields() protected had a sense and don't interefere with anything.

      Now in Moodle 2.x backup/restore is handled by separate classes that nees access to extra_question_fields(), questionid_column_name() and extra_answer_fields() functions. So these methods really should be public now (if possible - starting from 2.0 or at least 2.1).

      Tim, if you want, we could provide a git branch with the change, but it's really rather trivial so you may prefer doing it by youself.

        Gliffy Diagrams

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Fix Release Date:
                    9/Jan/12