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

Database entry tags problem.

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide
      1. Create a new database.
      2. Add a date field named "date" and description "date".
      3. Add a new entry with random date and assign a tag named TAGNAME.
      4. Add the tag block to the course.
      5. Click on the tag you added on step3 (TAGNAME).
      6. URL should be something like: /tag/index.php?tc=1&tag=TAGNAME
      7. Check the entry you've added on step 3 is shown.
      8. Check the entry title is a well formatted date.
      9. Enter the database again.
      10. Click on the Search tab and check no PHP warning is shown.
      Show
      Create a new database. Add a date field named "date" and description "date". Add a new entry with random date and assign a tag named TAGNAME. Add the tag block to the course. Click on the tag you added on step3 (TAGNAME). URL should be something like: /tag/index.php?tc=1&tag=TAGNAME Check the entry you've added on step 3 is shown. Check the entry title is a well formatted date. Enter the database again. Click on the Search tab and check no PHP warning is shown.
    • Workaround:
      Hide

      Set the add template to the database activity.

      Show
      Set the add template to the database activity.
    • Difficulty:
      Easy
    • Affected Branches:
      MOODLE_36_STABLE, MOODLE_37_STABLE
    • Pull Master Branch:
      MDL-66386-master

      Description

      To reproduce, follow those exact steps on the testing instructions, on step 7 an error will be raised.

      The error is raised because the database cannot determine which field use as a title on the database.
       

      Notice:  Trying to get property of non-object in /mod/data/locallib.php on line 1004
       
      Warning:  
      require_once(/mod/data/field//field.class.php):
       failed to open stream: No such file or directory in /mod/data/locallib.php on line 1004
       
       
      Fatal error:  require_once(): Failed opening required 
      '/mod/data/field//field.class.php'
       
      (include_path='/lib/pear:.:/usr/local/Cellar/php@7.1/7.1.22/share/php@7.1/pear')
       in /mod/data/locallib.php on line 1004 

       

      On mod_data_get_tagged_records function calls data_get_tag_title_field but no return is done. So when calling data_get_tag_title_for_entry and error is raised.

      To solve that I think it should check if data_get_tag_title_field returns empty and have a default or none $pagename when this happens.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              pferre22 Pau Ferrer
              Reporter:
              pferre22 Pau Ferrer
              Peer reviewer:
              Ferran Recio
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:

                  Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 3 hours, 20 minutes
                  3h 20m