Forums | Mahara Community
Support
/
Items stuck on loading when editing pages
20 November 2015, 1:49
Hi All
I wonder if anyone else has experienced this problem - We're currently on 1.8 and have been for around a year or so, but most recently we've started having issues with the items menu on the left hand side when editing a page.
The text box, image and media section all loads fine, but when I click onto Journals, General, Personal info, and External, all I get is 'Loading...' and it never loads.
I've tried using different browsers but find the same problem. (I've tried to post a screenshot of the problem but i get "Sorry, newly registered users aren't allowed to post links. Please reword your post to remove any links or URLs and try again"
Any insight is much appreciated.
Many Thanks
Nazryn
Newman University
20 November 2015, 11:03
Hi Nazryn,
I've turned off the "new user probation" setting on your account, so you should be able to post links now. :)
If you're seeing nothing but the "Loading" icon, and it's happening in different browsers, then it probably means that the underlying ajax request that is meant to load up the content, is erroring out.
Please check your PHP error logs. (On most operating systems, these are rolled into the Apache error logs, perhaps under /var/log/apache2/error.log or /var/log/httpd/error.log). If you see any big PHP error stacks there, post them here and that may help us understand what's gone wrong.
Or if you don't have access to your PHP error logs, and you don't mind temporarily switching your site to non-production mode, you could do that and then the error will get printed into the web browser. To this you would edit your site's config.php file, and add this to the bottom:
$cfg->productionmode = false;
Then replicate the problem, and then reload the page. If there is a server-side error, you will probably see a big error stack printed on the webpage.
Cheers,
Aaron
26 November 2015, 4:10
Hi Aaron
Many thanks for your reply - I've just spoken to our IT team and they've said there are no errors present. We've recorded a short video to show what happens on Mahara:
We've not made any changes to Mahara recently so we're a bit stumped as to what might have caused this.
Many thanks
Nazryn
26 November 2015, 15:16
Hi Nazryn,
Thanks for the video. That always does help to clarify that we're both talking about the same thing. :)
Yeah, the issue you're seeing is consistent with the AJAX request for the menu failing to come back properly. We lazy-load those lists of blocks in the block picker via AJAX. The first time you expand one, Mahara, via Javascript, fires off a request to view/blocks.json.php, which then comes back with the list of content to display there. While it's waiting for that JSON to come back it shows the word "Loading...", and then once it comes back, it replaces "Loading..." with the actual content. Unfortunately we don't have a good error handler in place there, so if the AJAX fails to come back, the "Loading..." shows forever, even though it's actually no longer loading.
I can replicate the issue in your video by going into my own Mahara installation, editing the htdocs/view/blocks.json.php file, and adding the invalid function call "thiswillcrash();" to it, which causes blocks.json.php to error out.
It is strange that you're not seeing any errors in your logs, though. One more thing I would try, just in case the admins were looking in the wrong place, is in your site's config.php file, switch $cfg->productionmode to false. This will cause any catchable errors to be printed to the Mahara screen, on the next page load. Note this will add a big "This site is not in production mode" banner to the top of each page, so you'll want to do it during a maintenance shutdown to avoid alarming your users.
Another thing that might provide some insight is to use your web browser's Developer Tools "Network" tab, to directly inspect the JSON request. (I believe Firefox, Chrome, and IE all have a similar set of developer tools built in now, with this functionality.) On a successful request, you'd see the request to blocks.json.php come back with some nice formatted JSON, like this:
While on an unsuccessful request you'll probably either see it come back with an HTTP error code, or a blank response, or maybe even a PHP error stack, like this:
Oh, another thing I noticed while testing this is that the browser caches the results of these requests rather aggressively. So you'll want to clear your browser cache in order to make sure you're actually requesting it, and not just using your cached response.
Given that you haven't changed anything in Mahara recently, it's most likely that this problem is going to be due to something in your server software or network.
Cheers,
Aaron
27 November 2015, 22:10
Hi, I'm the IT support team member that's been working with Nazryn on this.I'm not, initially, seeing any requests to view/blocks.json.php, either in the apache logs or firebug. At this stage the "Media" sub-menu is populated, but none of the others.
If I temporarily turn off javascript in my browser, insert one or more items using the fall back mechanism, and turn javascript back on, then the sub-menu that the last item inserted was from is populated and I see requests to view/blocks.json.php for that sub-menu when I open and close it, but still not for other sub-menus when I open and close them. This also leaves the "Media" sub-menu unpopulated.
30 November 2015, 11:22
Hi Philip,
Do you experience the same issue on any other Mahara sites (for instance, if you go to https://mahara.org/view/index.php and create a new page)? Or install a copy of Mahara 1.8 on your local machine (if you're running Linux) and see if it has the same problem.
Since I can't replicate the problem in a clean install of Mahara 1.8, there's not really much else I can do to help with this, other than to suggest maybe using the Javascript debugger to see if you can figure out what's going on.
I should also mention, Mahara 1.8 is no longer receiving bug fixes. (See https://wiki.mahara.org/wiki/SupportedVersions ). So you should look into upgrading to Mahara 1.10 or later.
Cheers,
Aaron
03 December 2015, 3:15
I think I've solved it, and got things working again.
The page was picking up a more modern version of JQuery accordion than it expected - one that used "beforeActivate" and "activate" events, instead of the "change" event the code assumed.