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

Check if string exists to avoid 'invalid get_string() identifier' msg when using calendar events in non modules

    XMLWordPrintable

    Details

    • Testing Instructions:
      Hide

      If Workplace plugins are not installed and there are no events related to programs and certifications these events should display in the calendar as usual:

      1. Go to Calendar
      2. Click on 'New event'
      3. Type 'Test event' in 'Event title' field.
      4. Choose todays date
      5. Select type of event 'User'
      6. Click 'Save'
      7. Click on the event we have just created on the calendar
      8. A modal should open showing title, date, time and event type (User event).
      9. Now the tricky part. Modify the 'eventtype' in database for this event and change it from 'user' to 'tool_certification1' (or any other value) and save it.
      10. Go back to Dashboard and check there is no warning.
      11. Go to Calendar and check that there is no warning about missing strings.
      12. Click on the event we have created before on the calendar
      13. A modal should open showing title, date, time. In this case Event type should not be visible.

       

      For better testing instructions this should be tested using workplace and having at least one program / certification event in the user calendar.

       

      Show
      If Workplace plugins are not installed and there are no events related to programs and certifications these events should display in the calendar as usual: Go to Calendar Click on 'New event' Type 'Test event' in 'Event title' field. Choose todays date Select type of event 'User' Click 'Save' Click on the event we have just created on the calendar A modal should open showing title, date, time and event type ( User event ). Now the tricky part. Modify the 'eventtype' in database for this event and change it from 'user' to 'tool_certification1' (or any other value) and save it. Go back to Dashboard and check there is no warning. Go to Calendar and check that there is no warning about missing strings. Click on the event we have created before on the calendar A modal should open showing title, date, time. In this case Event type should not be visible .   For better testing instructions this should be tested using workplace and having at least one program / certification event in the user calendar.  
    • Affected Branches:
      MOODLE_37_STABLE
    • Fixed Branches:
      MOODLE_37_STABLE
    • Pull from Repository:
    • Pull 3.7 Branch:
    • Pull Master Branch:
      MDL-65699-master

      Description

      We are currently using calendar events in Workplace plugins and we are getting 'invalid get_string() identifier' messages because we are not using modules and is trying to locate strings in lang/en/calendar.php that don't exist. It would be nice if at least we can have this fixed while MDL-58866 is not resolved.

       

      One way to test it shows a warning would be to change the ‘eventtype’ value directly in database in mdl_event table. Just create one 'User' type event and look for the eventin db and eventtype should be = ‘user’. Modify it manually to ‘tool_certification1’ and save it. After that go to Calendar and you should see a warning like this:

      Invalid get_string() identifier: 'typetool_certification1' or component 'calendar'. Perhaps you are missing $string['typetool_certification1'] = ''; in lang/en/calendar.php?line 353 of /lib/classes/string_manager_standard.php: call to debugging()line 7255 of /lib/moodlelib.php: call to core_string_manager_standard->get_string()line 278 of /calendar/classes/external/event_exporter_base.php: call to get_string()line 91 of /calendar/classes/external/calendar_event_exporter.php: call to core_calendar\external\event_exporter_base->get_other_values()line 125 of /lib/classes/external/exporter.php: call to core_calendar\external\calendar_event_exporter->get_other_values()line 205 of /calendar/classes/external/day_exporter.php: call to core\external\exporter->export()line ? of unknownfile: call to core_calendar\external\day_exporter->core_calendar\external\{closure}()line 206 of /calendar/classes/external/day_exporter.php: call to array_map()line 101 of /calendar/classes/external/week_day_exporter.php: call to core_calendar\external\day_exporter->get_other_values()line 125 of /lib/classes/external/exporter.php: call to core_calendar\external\week_day_exporter->get_other_values()line 164 of /calendar/classes/external/week_exporter.php: call to core\external\exporter->export()line 125 of /lib/classes/external/exporter.php: call to core_calendar\external\week_exporter->get_other_values()line 313 of /calendar/classes/external/month_exporter.php: call to core\external\exporter->export()line 215 of /calendar/classes/external/month_exporter.php: call to core_calendar\external\month_exporter->get_weeks()line 125 of /lib/classes/external/exporter.php: call to core_calendar\external\month_exporter->get_other_values()line 3429 of /calendar/lib.php: call to core\external\exporter->export()line 129 of /calendar/view.php: call to calendar_get_view()

      One proposal to resolve this issue could be adding "if string_exists()".

      Thanks!

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                davidmatamoros David Matamoros
                Reporter:
                davidmatamoros David Matamoros
                Peer reviewer:
                Marina Glancy
                Integrator:
                Adrian Greeve
                Tester:
                Jake Dallimore
                Participants:
                Component watchers:
                Andrew Nicols, Mathew May, Michael Hawkins, Shamim Rezaie, Simey Lameze, Amaia Anabitarte, Bas Brands, Carlos Escobedo, Sara Arjona (@sarjona), Víctor Déniz Falcón
              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved:
                  Fix Release Date:
                  8/Jul/19

                  Time Tracking

                  Estimated:
                  Original Estimate - 0 minutes
                  0m
                  Remaining:
                  Remaining Estimate - 0 minutes
                  0m
                  Logged:
                  Time Spent - 2 hours, 50 minutes
                  2h 50m