Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working inside course anymore #10

Open
r3g31rk opened this issue Jan 12, 2020 · 9 comments
Open

Not working inside course anymore #10

r3g31rk opened this issue Jan 12, 2020 · 9 comments
Assignees
Labels
bug Something isn't working

Comments

@r3g31rk
Copy link

r3g31rk commented Jan 12, 2020

Hello, and thank you Luuk for this amaaaaaaazing tool.
Since the upgrade to 3.8.2 (2019120900) (2019120900), it appears our shortcut (custom touch 222, instead of 192) is not working when we are inside a course. We have 3 category of courses (catA, catB, and Templates), the commander is not working anymore in the categories catA and catB. But still working inside the category Templates.

It is working as usual in any other pages (frontpage, dashboard, site administration...).

(remarks, could this be related, OR NOT, to the usage of the https://moodle.org/plugins/filter_shortcodes? I changed some settings recently, and I try to add my first stash and my first item. I think the bug appears after that. but I'm not sure anymore, I did a lot!)

@r3g31rk
Copy link
Author

r3g31rk commented Jan 12, 2020

I reinstall precedent version of the plugin, and I still have the same bug.
It's late, I'm gonna try to dig this tomorrow. I think it is related to "stash" but I'm not sure.

Here is what I change on our install (in chronological order)

  1. update commander + install plugin "course_dedication" and "smartklass"
  2. uninstall "smartklass" (and "autogroup" an old plugin I don't need anymore)
  3. back to old version of commander (because it wasn't working anymore)

I am sure that commander was normally working shortly after step 2.
The only "unusual" thing I did was (AFTER step 2, I'm almost sure of that) to use, for the first time, the plugin https://moodle.org/plugins/block_stash (the 3 plugins related to it were already installed for a while but I never used it.)

So I add a "stash block", create my first stash, add my first item, then paste a snippet code into the description of a "file" activity, then I pick it up (as a student, and as an admin=me).

I did some stuff I can't even remember (I will check logs tomorrow), then I realise commander wasn't working anymore inside ANY course.I think it could be related to a filter.

If you have an idea or question, I will be honored!

@r3g31rk
Copy link
Author

r3g31rk commented Jan 12, 2020

Hi,
I check the logs this morning, and I found this :
User="Admin global"
Event context="System"
Component="System"
Event name="Search data indexed"
Description="The user with id '2' updated the search engine data"

When I go on the page "Site administration>Plugins>Search>Search areas", i can found the line:
Search area="File",Search area categories="All, Course content",Enable="Yes",Newest document indexed="Sunday,12 january 2020 2:27 AM",Last run="0,0,0,0",Index actions="Delete index or Gradual reindex"

@r3g31rk
Copy link
Author

r3g31rk commented Jan 12, 2020

In Site administration>Plugins>Search, I can see that a setting is "Default: Search within enrolled courses only", and we don't have any enrolled sudent in any course of the "Template" category.
So I really think it is related to indexation and or filters!

@luukverhoeven
Copy link
Member

Hi @r3g31rk,

Thanks for your messages. Sorry for the delayed response.

Can you describe in a few steps how I can replicate this scenario in a fresh Moodle 3.8.2? Maybe I can debug it, I expect there is some JS conflict.

@luukverhoeven luukverhoeven self-assigned this Jan 21, 2020
@luukverhoeven luukverhoeven added the bug Something isn't working label Jan 21, 2020
@r3g31rk
Copy link
Author

r3g31rk commented Jan 23, 2020

Hi Luuk,

In a few steps:

  1. I updated commander to its newest version
    (2. I add a 'stash block' and a 'stash item' into one course using plugin https://moodle.org/plugins/block_stash) Don't know if it is related to the bug, but it seems to be!
  2. I notice this bug: When I am inside some courses categories (not all of them!), the Commander "windows" stills display, but it is empty from any shortcut.
  3. I downgrade commander to its previous version, and the bug was still here.

I think it is related to "filters", which are used by the "stash block"

(An uncommon task occured during that night on our Moodle instance:
-> "Site administration>Plugins>Search>Search areas", I can found the line:
Search area="File",Search area categories="All, Course content",Enable="Yes",Newest document indexed="Sunday,12 january 2020 2:27 AM",Last run="0,0,0,0",Index actions="Delete index or Gradual reindex")

@luukverhoeven
Copy link
Member

Thanks for the steps to replicate this bug. I tested it on my dev environment and don't see the issue. Can you check the output from /local/commander/ajax.php?courseid=1

Maybe it helps to turn on developer mode (temporary):
afbeelding

To check the AJAX request, you can use developer tool inside the browser. See my screencast:
https://www.dropbox.com/s/uoq6vqfborb7sb6/2020-01-24_00-14-24.mp4?dl=0

@r3g31rk
Copy link
Author

r3g31rk commented Feb 6, 2020

Hi Luuk,
Sorry for delay, we are kind of busy actually!

When I run the command, Iget something like this

{"admin":{"id":null,"name":"Site administration","link":"https://staging.gandalf.epitech.eu/admin/search.php","hidden":false,"haschildren":true,"children":[{"id":null,"name":"Notifications","link":"https://staging.gandalf.epitech.eu/admin/index.php","hidden":false,"haschildren":false},{"id":null,"name":"Registration","link":"https://staging.gandalf.epitech.eu/admin/registration/index.php","hidden":false,"haschildren":false},{"id":null,"name":"Moodle services","link":"https://staging.gandalf.epitech.eu/admin/settings.php?section=moodleservices","hidden":false,"haschildren":false},{"id":null,"name":"Advanced features","link":"https://staging.gandalf.epitech.eu/admin/settings.php?section=optionalsubsystems","hidden":false,"haschildren":false},
...
...

We already have the developper mode turned ON.

I followed your advice by using "inspect" while using Commander:

  • when I am outside a course of the category "projects" (the one where commander is not working anymore) I get the same output as your video
  • but when I am inside a course of the category "projects", it seems that the bug is related to the plugin "local_bs_badge_pool"

bug_inside_course

luukverhoeven added a commit that referenced this issue Feb 23, 2020
Context not used correctly when in $courseid is provided.

Tracker #10
@luukverhoeven
Copy link
Member

I think I found the problem. Can you check if the latest version solves the issue?

Wrong context was used when courseid was provided to ajax.php

--

local_bs_badge_pool uses $PAGE->context to extends the navigation.
https://github.com/m-schwabe/local_bs_badge_pool/blob/master/lib.php#L55

@r3g31rk
Copy link
Author

r3g31rk commented Mar 15, 2020

Hi Luuk,

Sorry, we had quite a rush recently (new semester started few days ago).

I just installed your latest version on our staging, and the issue is still here:

  • I can NOT use commander into categories 3/4/5 where the plugin bs_badge_pool is enabled
  • I can use commander everywhere else on the site

Remark (or clue?): with the old version of commander, I recently saw an error popup (something like "Local Commander: JS parsing error"), but I can't find out how to reproduce it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants