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

My Overview Block's Tabs Don't Work #106

Open
nyanginator opened this issue Jul 26, 2017 · 5 comments
Open

My Overview Block's Tabs Don't Work #106

nyanginator opened this issue Jul 26, 2017 · 5 comments
Labels

Comments

@nyanginator
Copy link

On the newly revamped Moodle 3.3 Dashboard, the "myoverview" block is now used in place of "courseoverview". There are tabs for Courses, Timeline, Sort by Date, Sort by Courses, In Progress, Future, and Past. None of these tabs are working when Clean URLs is enabled. Nothing happens when they are clicked, except in Chrome, where this browser error shows sometimes:

jquery-3.1.0.min.js:1 Uncaught Error: Syntax error, unrecognized expression: http://localhost/cleanmoodle/my/#myoverview_timeline_courses
    at Function.ga.error (jquery-3.1.0.min.js:1)
    at ga.tokenize (jquery-3.1.0.min.js:1)
    at ga.select (jquery-3.1.0.min.js:1)
    at Function.ga [as find] (jquery-3.1.0.min.js:1)
    at r.fn.init.find (jquery-3.1.0.min.js:1)
    at r.fn.init (jquery-3.1.0.min.js:1)
    at r (jquery-3.1.0.min.js:1)
    at HTMLDivElement.<anonymous> ((index):1077)
    at HTMLDivElement.dispatch (jquery-3.1.0.min.js:1)
    at HTMLDivElement.q.handle (jquery-3.1.0.min.js:1)

I tried searching for the error, resulting in this thread https://moodle.org/mod/forum/discuss.php?d=344183#p1391626, which mentions removing the # to make the error go away. Ignoring links with # is how I did the quick fix in #104 (comment).

For this My Overview block case, I couldn't find any # signs in the $this->originalurl link, so my quick fix for this involved cleaning only course and mod URLs on the Dashboard page in /local/cleanurls/classes/local/cleaner/cleaner.php:

private function execute() {

    if (strpos($PAGE->pagetype, 'my-index') !== false) {
        $url = $this->originalurl->raw_out(false);
        if (strpos($url, '/course/') == false && strpos($url, '/mod/') == false) {
            return;
        }
    }

   ...

Hope this info is helpful in pinpointing the underlying issue.

@nyanginator nyanginator changed the title My Overview Block's Tabs Don't Work My Overview Block's Tabs Don't Work (Chrome) Jul 26, 2017
@nyanginator nyanginator changed the title My Overview Block's Tabs Don't Work (Chrome) My Overview Block's Tabs Don't Work Jul 26, 2017
@brendanheywood
Copy link
Owner

I think we found the same issue on the admin search tabs and have fixed this. @nyanginator can you please re-test with the latest code in git?

@nyanginator
Copy link
Author

just re-downloaded, still same problem. Admin tabs work fine, but not Dashboard.

@brendanheywood
Copy link
Owner

Ah sorry, can you retry using this branch:

https://github.com/brendanheywood/moodle-local_cleanurls/tree/development

@nyanginator
Copy link
Author

yup, looks like it's working now!

@brendanheywood
Copy link
Owner

ok just a heads up that we have a long running dev branch with some fairly major changes in it. We will merge back once it is all stable probably a couple weeks away. Feel free to use at your own risk :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants