Hey Gareth,
So I followed what you said and surprise it worked
. Thx
I went over the debugging report with the help of chatGPT. You will find the full debugging report attached to this message.
Please note that before adding your theme I duplicated the top navigation menu ( courses,
dashboard, admin ). One of the issue might be stemming from there but I dought it considering the number of categories affected by the duplication error.
According to chatGPT there are two types of bugs present :
1. A lot of categories are duplicated which causes an error.
2. The last two bugs reported would originate from a syntax error in the theme code.
Below I pasted the response from ChatGPT related to the two types of bugs. But as I said there are multiple duplication errors reported in the debugging report.
First type of bug
Duplicate admin category name: analytics
- line 990 of
/lib/adminlib.php: call to debugging()
- line 34 of
/admin/settings/top.php: call to admin_category->add()
- line 8770 of
/lib/adminlib.php: call to require()
- line 4528 of
/lib/navigationlib.php: call to admin_get_root()
- line 4391 of
/lib/navigationlib.php: call to
settings_navigation->load_administration_settings()
- line 838 of
/lib/pagelib.php: call to settings_navigation->initialise()
- line 967 of
/lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
- line 110 of
/blocks/admin_bookmarks/block_admin_bookmarks.php: call to
moodle_page->__get()
- line 337 of
/blocks/moodleblock.class.php: call to
block_admin_bookmarks->get_content()
- line 231 of
/blocks/moodleblock.class.php: call to block_base->formatted_contents()
- line 1231 of
/lib/blocklib.php: call to block_base->get_content_for_output()
- line 1289 of
/lib/blocklib.php: call to block_manager->create_block_contents()
- line 377 of
/lib/blocklib.php: call to block_manager->ensure_content_created()
- line 4179 of
/lib/outputrenderers.php: call to block_manager->region_has_content()
- line 50 of
/theme/boost/layout/drawers.php: call to core_renderer->blocks()
- line 1486 of
/lib/outputrenderers.php: call to include()
- line 1412 of
/lib/outputrenderers.php: call to core_renderer->render_page_layout()
- line 3026 of
/lib/outputrenderers.php: call to core_renderer->header()
- line 389 of
/lib/setuplib.php: call to core_renderer->fatal_error()
- line ? of unknownfile: call to
default_exception_handler()
Message from chatGPT : The error message “Duplicate admin category name:
analytics” indicates that the Moodle system is trying to create an admin
category named ‘analytics’ that already exists.
The error occurs when the system tries to add this
category in the /admin/settings/top.php
file
(line 34). The admin_category->add()
function
is called here, which is defined in the /lib/adminlib.php
file
(line 990).
This function seems to be checking if the category
already exists, and if it does, it raises a debugging message. The rest of the
stack trace is showing the sequence of function calls that led to this point.
To resolve this issue, you need to check why these
categories are being added multiple times. It could be due to some custom code
in your Moodle setup or a misconfiguration. You should look into the /admin/settings/top.php
file
and the code that is causing these categories to be added.
Error with adaptable category
Duplicate
admin category name: theme_adaptable
- line 990 of
/lib/adminlib.php: call to debugging()
- line 36 of
/theme/adaptable/settings.php: call to admin_category->add()
- line 57 of
/admin/settings/appearance.php: call to include()
- line 8781 of
/lib/adminlib.php: call to require()
- line 4528 of
/lib/navigationlib.php: call to admin_get_root()
- line 4391 of
/lib/navigationlib.php: call to
settings_navigation->load_administration_settings()
- line 838 of
/lib/pagelib.php: call to settings_navigation->initialise()
- line 967 of
/lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
- line 110 of
/blocks/admin_bookmarks/block_admin_bookmarks.php: call to
moodle_page->__get()
- line 337 of
/blocks/moodleblock.class.php: call to
block_admin_bookmarks->get_content()
- line 231 of
/blocks/moodleblock.class.php: call to block_base->formatted_contents()
- line 1231 of
/lib/blocklib.php: call to block_base->get_content_for_output()
- line 1289 of
/lib/blocklib.php: call to block_manager->create_block_contents()
- line 377 of
/lib/blocklib.php: call to block_manager->ensure_content_created()
- line 4179 of
/lib/outputrenderers.php: call to block_manager->region_has_content()
- line 50 of
/theme/boost/layout/drawers.php: call to core_renderer->blocks()
- line 1486 of
/lib/outputrenderers.php: call to include()
- line 1412 of
/lib/outputrenderers.php: call to core_renderer->render_page_layout()
- line 3026 of
/lib/outputrenderers.php: call to core_renderer->header()
- line 389 of
/lib/setuplib.php: call to core_renderer->fatal_error()
- line ? of
unknownfile: call to default_exception_handler()
Message from chatGPT : The error message you’re seeing is related to a
duplicate admin category name, specifically theme_adaptable
.
This error is typically caused when Moodle tries to create an admin category
that already exists.
From the stack trace, it appears that the duplication
is happening in the settings.php
file
of the adaptable
theme.
Specifically, the admin_category->add()
function
is being called, which is leading to the duplication error.
Here’s a potential solution: You could check the settings.php
file
in the adaptable
theme
directory and ensure that it’s not trying to create an admin category that
already exists. If it is, you might need to modify this file to prevent the
duplication.
Second type of bug
Exception -
syntax error, unexpected token "<", expecting end of file
Debug info:
Error code: generalexceptionmessage
Stack
trace:
- line 135 of
/theme/adaptable/settings/analytics.php: ParseError thrown
- line 57 of
/admin/settings/appearance.php: call to include()
- line 8781 of
/lib/adminlib.php: call to require()
- line 842 of
/admin/index.php: call to admin_get_root()
and this
bug
Exception -
syntax error, unexpected token "<", expecting end of file
Debug info:
Error code: generalexceptionmessage
Stack
trace:
- line 135 of
/theme/adaptable/settings/analytics.php: ParseError thrown
- line 57 of
/admin/settings/appearance.php: call to include()
- line 8781 of
/lib/adminlib.php: call to require()
- line 4528 of
/lib/navigationlib.php: call to admin_get_root()
- line 4391 of
/lib/navigationlib.php: call to
settings_navigation->load_administration_settings()
- line 838 of
/lib/pagelib.php: call to settings_navigation->initialise()
- line 967 of
/lib/pagelib.php: call to moodle_page->magic_get_settingsnav()
- line 110 of
/blocks/admin_bookmarks/block_admin_bookmarks.php: call to
moodle_page->__get()
- line 337 of
/blocks/moodleblock.class.php: call to
block_admin_bookmarks->get_content()
- line 231 of
/blocks/moodleblock.class.php: call to block_base->formatted_contents()
- line 1231 of
/lib/blocklib.php: call to block_base->get_content_for_output()
- line 1289 of
/lib/blocklib.php: call to block_manager->create_block_contents()
- line 377 of
/lib/blocklib.php: call to block_manager->ensure_content_created()
- line 4179 of
/lib/outputrenderers.php: call to block_manager->region_has_content()
- line 50 of
/theme/boost/layout/drawers.php: call to core_renderer->blocks()
- line 1486 of
/lib/outputrenderers.php: call to include()
- line 1412 of
/lib/outputrenderers.php: call to core_renderer->render_page_layout()
- line 3026 of
/lib/outputrenderers.php: call to core_renderer->header()
- line 389 of
/lib/setuplib.php: call to core_renderer->fatal_error()
- line ? of
unknownfile: call to default_exception_handler()
Same error message for the last two bugs
Message from chatGPT : The error message you’re seeing is a ParseError
and
it’s typically caused by a syntax error in your PHP code. The error message
indicates that an unexpected token “<” was found, but the end of the file
was expected. This often happens when there is a missing or extra bracket,
semicolon, or some other syntax error in the code.
From the stack trace, it appears that the error is
occurring in the analytics.php
file
of the adaptable
theme,
specifically on line 135.
Here’s a potential solution: You could open the analytics.php
file
in a text editor and go to line 135. Check the syntax around this line
carefully for any errors. Look for missing or extra brackets, semicolons, or
other syntax issues.