[adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

[adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Richard van Iwaarden -
Number of replies: 10
Picture of Particularly helpful Moodlers

I'm getting the following error on the front page:

Exception - Class 'theme_adaptable\output\core\lang_string' not found

More information about this error

Debug info: 
Error code: generalexceptionmessage
Stack trace:
  • line 367 of /theme/adaptable/classes/output/core/course_renderer.php: Error thrown
  • line 247 of /index.php: call to theme_adaptable\output\core\course_renderer->frontpage_my_courses()


Using Moodle 3.4+ (Build: 20180112) and adaptable 1.6.0.1 (2018011501).


I have no folder 'output' in the theme folder adaptable?

Average of ratings: -
In reply to Richard van Iwaarden

Re: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Gareth J Barnard -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Plugin developers

Add a '\' in front of 'lang_string' on line 367 of '/theme/adaptable/classes/output/core/course_renderer.php', i.e. '\lang_string'.

In reply to Richard van Iwaarden

Re: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Manoj Solanki -

Thank you for raising this Richard.

This occurs due to a frontpage course limit that is less than the number of courses a user is enrolled on when displaying enrolled courses on the frontpage.  For example, if frontpagecourselimit is set to 1, and user is enrolled on 5 courses, this error will display. A temporary workaround would be to set a course limit higher than how many courses a user is likely to be enrolled on.

We'll have a fix done soon and keep you updated.  

Thanks,

Manoj


In reply to Manoj Solanki

Re: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Greg Lind -

Moodle 3.4 20171113 just updated Adaptable and I get the same error.

I tried Richard's solution (edit course_renderer.php) but that didn't work form me so I changed it back to original code.

I'm looking for where I can change the number of courses to show as suggested by Manoj, but I don't see it in Adaptable nor in Server Admin. I'm probably missing something obvious. Hopefully somebody can point me in the right direction.

[EDIT]

I had found it, but thought I was in the wrong place because it didn't have any effect when I changed Manoj's values.

Here's what resolved the issue for me.

Site Administration -->Front page --> Front Page Settings

  • Front page items when logged in --> List of courses. When set to enrolled courses I get the error.
  • My default was 200. I changed it to 500 just for drill but this had no effect so I changed it back to 200.

The only thing that made a difference for me was changing to show all courses when logged in.

It's an annoying glitch, but I'm a big fan of Adaptable and I appreciate the team's work. 

I'm looking forward to the update. Thanks.

In reply to Greg Lind

Re: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Manoj Solanki -

Hi Greg,

Apologies, you are correct that changing the max number of courses doesn't have an effect as I expected.  I think you were referring to Gareth's suggestion earlier when trying a code fix? If you tried that, I would expect that you probably saw a different error message from the original?

I'm working on a fix at present and we'll have this released soon.

Thanks,

M



In reply to Manoj Solanki

Re: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Manoj Solanki -

Hi,

Just to update you, this has been fixed in our GIT version control repository.  A new version will be released on Moodle.org  soon.  To get the version with the fix sooner, the zip file for the latest version can be downloaded from here: https://bitbucket.org/covuni/moodle-theme_adaptable/branch/master.  This would mean you would need install manually of course and FTP the files over to the server to replace the existing Adaptable theme installation.


Thanks,

Manoj

In reply to Manoj Solanki

Re: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Manoj Solanki -

Hi all,

Further to my last message, a new version of Adaptable, 1.6.0.2 has now been released released on Moodle.org containing the fix for this issue: https://moodle.org/plugins/theme_adaptable

Thanks,

Manoj

In reply to Manoj Solanki

Re: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by Greg Lind -

I would like to thank the development team for rapidly responding and resolving the issue. Bravo.

In reply to Richard van Iwaarden

ตอบ: [adaptable] Exception - Class 'theme_adaptable\output\core\lang_string' not found

by สามารถ สิงห์มา -

Edit --> theme/adaptable/classes/output/core/course_renderer.php

use cm_info;

use core_text;

use html_writer;

use context_course;

use moodle_url;

use coursecat_helper;


class course_renderer extends \core_course_renderer {


//////////// Change to ///////////


use cm_info;

use core_text;

use html_writer;

use context_course;

use moodle_url;

use coursecat_helper;

use lang_string;

use course_in_list;

use stdClass;

use renderable;

use action_link;


class course_renderer extends \core_course_renderer {