Exception - syntax error, unexpected token ",", expecting ":"

Exception - syntax error, unexpected token ",", expecting ":"

بواسطة - umesh chavan
عدد الردود: 5

Dear All,

I have been using MOODLE at our institute, on local server UBUNTU, we have installed MariaDB, apache2, PHP8.1 and Moodle 4.4.1

While updateing the theme MOOVE, it displayed error saying no version validation. Tried few things and now we are unable to acces the site at all.The error message appears as

Exception - syntax error, unexpected token ",", expecting ":"

Tried same version of moodle installed in different folder and gave the db and data path (added the same config.php file) but the error is same.

Tried again new installation of the same moodle version and created new config.php files and configured the db and data path....again it give s the same error.

can you please help me resolve this issues.

Thank you in advance

Umesh 

متوسط التقييمات: -
رداً على umesh chavan

Re: Exception - syntax error, unexpected token ",", expecting ":"

بواسطة - Visvanath Ratnaweera
صورة Particularly helpful Moodlers صورة Translators
These errors are typically incompatibilities with PHP, in this case an old version of Moove.

For the emergency, you can recover the site by switching to the standard theme Boost. Add the following line to moodle/config.php:

$CFG->theme='boost';
 
P.S. I think, this is an Installing and upgrading problem.
رداً على Visvanath Ratnaweera

Re: Exception - syntax error, unexpected token ",", expecting ":"

بواسطة - umesh chavan
Thank you Vishvanath ji,

I ggoogled a lot for this and could resolve the issue.
1. The problem was, when I tried updating the plugin MOOVE, it gave me an error

Validating xxxx-xxxx(plugin name) ... Error
[Error] Plugin does not declare its version [null]
Installation aborted due to validation failure

2. then i tried coping the folder intot he moodle respetcive plugin folder.
3. still it didnt wokred hence i removed the plugin moove folder
4. then all got stuck with that syntax error.
4. found that the moodle database was unable to udate via browser
5. so tried updating moodle database from CLI
6. and it worked for me.

But now the problem is none of the plugins gets installed or update, it leaves the error

Validating report_assign ... Error
[Error] Plugin does not declare its version [null]
Installation aborted due to validation failure

how to resolve this
رداً على umesh chavan

Re: Exception - syntax error, unexpected token ",", expecting ":"

بواسطة - Lexy Walker
صورة Core developers
Turn on debugging by editing your config.php. Find out which line of which file is causing the error. Go and look at it, and post that line here.

Moodle plugins need to have a file called version.php with the version number in. That has been required for over 10 years now. It sounds like one of your plugins didn't upload properly, or it's very very broken.

Find which plugin doesn't have a version.php and re-upload it.
رداً على umesh chavan

Re: Exception - syntax error, unexpected token ",", expecting ":"

بواسطة - Joel Stephens

I had this exact issue with the MOOVE theme not updating, and found myself with the exact error when I uninstalled the moove theme. How did you upgrade your database from the command line? I get the exception error every time I run a command from the cli.

Thanks,

Joel

رداً على Joel Stephens

Re: Exception - syntax error, unexpected token ",", expecting ":"

بواسطة - Visvanath Ratnaweera
صورة Particularly helpful Moodlers صورة Translators
I know, it is late. For others who have similar problems, move the theme directory, theme/moove/, away (outside of the moodle code directory) and add the line $CFG->theme='boost'; to the config.php file. That way you can get the Moodle admin interface up to continue.
 
The explanation to the mishap is that when you upgrade Moodle core, you don't necessarily upgrade additional plug-ins. If such a plug-in is not compatible with the new environment, it can break whole Moodle site.