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

Database entry tags problem.

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Open
    • Priority: Minor
    • Resolution: Unresolved
    • Affects Version/s: 3.6.5, 3.7.1
    • Fix Version/s: None
    • Labels:
    • Testing Instructions:
      Hide
      1. Create a new database.
      2. Add a textarea field named "text" and description "text".
      3. Add a new entry with random text 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.
      Show
      Create a new database. Add a textarea field named "text" and description "text". Add a new entry with random text 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.
    • 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

      Description

      To reproduce, follow those exact steps.

      1. Create a new database.
      2. Add a textarea field named "text" and description "text".
      3. Add a new entry with random text and assign a tag.
      4. Add the tag block to the course.
      5. Click on the tag you added on step3.
      6. URL should be something like: /tag/index.php?tc=1&tag=TAGNAME
      7. An error will be shown and no other content.

      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:
                Unassigned
                Reporter:
                pferre22 Pau Ferrer
                Participants:
                Component watchers:
                Adrian Greeve, Mihail Geshoski, Peter Dias, Amaia Anabitarte, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                1 Start watching this issue

                Dates

                • Created:
                  Updated: