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

Glossary entry webservice structure is missing aliases and categories

    • MOODLE_401_STABLE
    • MDL-77798-401
    • MDL-77798-403
    • MDL-77798-master
    • Hide

      This code add aliases and categories to WSs glossary functions. Since they use the same structure for entries is not necessary to test them one by one:

      • mod_glossary_get_entries_by_search
      • mod_glossary_get_entries_by_category
      • mod_glossary_get_entries_by_letter
      • mod_glossary_get_entries_by_date
      • mod_glossary_get_entries_by_author
      • mod_glossary_get_entries_by_author_id
      • mod_glossary_get_entries_by_term
      • mod_glossary_get_entries_to_approve
      • mod_glossary_get_entry_by_id
      1. As admin add a glossary module
      2. Edit the glossary settings and set its display format as Entry List: Appearance / Display Format/ Entry List
      3. Go to the glossary main page, change the filter to Browse by category and click on Edit Categories to Add new categories{}
      4. Add categories Category One and Category Two
      5. Add 3 entries to the glossary
        • One
          • add aliases (Keyword(s)) uno and um to it
          • add categories Category One and Category Two to it
        • Two
          • add an alias (Keyword(s)) dois to it
          • keep it as Not categorised
        • Three
          • add category Category One to it
      6. We use the following CURL command to test if the webservice works as required. Please note that the `$MOODLE_URL` , `$wstoken` and `$glossaryid` are parameters that need to be filled by you.

        curl '$MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_glossary_get_entries_by_author&wstoken=$wstoken&id=$glossaryid&letter=ALL' --compressed | python -m "json.tool" 

      7. Check if the entries have in the structure:
        • One
          • aliases: uno, um
          • two categories: Category One and Category Two
        • Two
          • aliases: dois
        • Three
          • categories: Category One
      Show
      This code add aliases and categories to WSs glossary functions. Since they use the same structure for entries is not necessary to test them one by one: mod_glossary_get_entries_by_search mod_glossary_get_entries_by_category mod_glossary_get_entries_by_letter mod_glossary_get_entries_by_date mod_glossary_get_entries_by_author mod_glossary_get_entries_by_author_id mod_glossary_get_entries_by_term mod_glossary_get_entries_to_approve mod_glossary_get_entry_by_id As admin add a glossary module Edit the glossary settings and set its display format as Entry List: Appearance / Display Format/ Entry List Go to the glossary main page, change the filter to Browse by category and click on Edit Categories to Add new categories { } Add categories Category One and Category Two Add 3 entries to the glossary One add aliases (Keyword(s)) uno and um to it add categories Category One and Category Two to it Two add an alias (Keyword(s)) dois  to it keep it as Not categorised Three add category Category One to it We use the following CURL command to test if the webservice works as required. Please note that the `$MOODLE_URL` , `$wstoken` and `$glossaryid` are parameters that need to be filled by you. curl '$MOODLE_URL/webservice/rest/server.php?moodlewsrestformat=json' --data 'wsfunction=mod_glossary_get_entries_by_author&wstoken=$wstoken&id=$glossaryid&letter=ALL' --compressed | python -m "json.tool" Check if the entries have in the structure: One aliases: uno,   um two categories: Category One and Category Two Two aliases: dois Three categories: Category One

      The format of entries returned in the glossary webservices is missing a couple of fields: aliases and categories.

      This is necessary, for example, in order to show these fields in the app edit form.

            jleyva Juan Leyva
            noeldemartin Noel De Martin
            Glyn (Mathew) May Glyn (Mathew) May
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0 minutes
                0m
                Logged:
                Time Spent - 4 days, 1 hour
                4d 1h

                  Error rendering 'clockify-timesheets-time-tracking-reports:timer-sidebar'. Please contact your Jira administrators.