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

Database entry tags problem.

    XMLWordPrintable

    Details

    • Affected Branches:
      MOODLE_310_STABLE, MOODLE_36_STABLE, MOODLE_37_STABLE, MOODLE_38_STABLE, MOODLE_39_STABLE
    • Pull 3.9 Branch:
    • Pull 3.10 Branch:
      MDL-66386-310
    • Pull 3.11 Branch:
      MDL-66386-311
    • Pull Master Branch:
      MDL-66386-master
    • Workaround:
      Hide

      Set the add template to the database activity.

      Show
      Set the add template to the database activity.
    • Difficulty:
      Easy
    • 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.

      Test search filtering problem

      1. On the same course add a new glossary.
      2. Add a new entry with title "a" and random description.
      3. Check or enable filter Glossary auto-linking.
      4. Enter the database again and navigate to the "Search" tab.
      5. Check all search fields are displayed correctly. (Before the patch it displays something like the following lines with letters "a" linked to the glossary, which is incorrect)
        Tags: ##tags##
        Author first name: ##firstname##
        Author surname: ##lastname##
      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. Test search filtering problem On the same course add a new glossary. Add a new entry with title "a" and random description. Check or enable filter Glossary auto-linking. Enter the database again and navigate to the "Search" tab. Check all search fields are displayed correctly. (Before the patch it displays something like the following lines with letters "a" linked to the glossary, which is incorrect) Tags: ##tags## Author first name: ##firstname## Author surname: ##lastname##

      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 Ferran Recio
              Participants:
              Component watchers:
              Adrian Greeve, Jake Dallimore, Mathew May, Mihail Geshoski, Peter Dias, Sujith Haridasan, Amaia Anabitarte, Carlos Escobedo, Ferran Recio, Ilya Tregubov, Sara Arjona (@sarjona)
              Votes:
              0 Vote for this issue
              Watchers:
              5 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 - 6 hours, 25 minutes
                  6h 25m