michael-milette / moodle-filter_filtercodes

FilterCodes filter for Moodle enables content creators to easily customize and personalize course and site content using plain text tags (no HTML). For premium support, contact us at https://www.tngconsulting.ca/contact
https://moodle.org/plugins/filter_filtercodes
GNU General Public License v3.0
32 stars 45 forks source link

Bug: PHP Fatal error: Duplicate declaration of static variable $mycohorts in /var/www/moodle/filter/filtercodes/classes/text_filter.php on line 4311 #308

Closed mputzi closed 2 days ago

mputzi commented 4 days ago

Prerequisites

What happened?

Upgrade of plugin stopped; site left unusable.

What do you think should have happened?

I expected the upgrade of the plugin to finish smoothly.

Steps to reproduce

  1. Login as admin
  2. Go to upgrade plugins
  3. nothing happens, site not loading
  4. Upgrading via cli
  5. See fatal error message on console

Screenshots

No response

Moodle version

4.4.3 (Build: 20240902)

Installed Moodle UI Language packs.

If other language(s), please specify

No response

Workaround

renaming variable in text_filter.php line 4311 and following lines of code block

Additional information

No response

System information

Client Device type: Desktop Client Operating System: Linux Client Web Browser: any Server Operating System: Linux Server Webserver: NGinx Server PHP: 8.3

Code of Conduct

jimsihk commented 4 days ago

Same error on Moodle 4.4.4 (Build: 20241007) and 4.5 (Build: 20241007), tried with a fresh copy of Moodle, can start up if disabled the filter. Once attempted to enable the filtercodes filter, Moodle will crash.

Issue happens since filtercode v2.6.0.

All0ne commented 4 days ago

Samoe error on Moodle 4.4.3+ (Build: 20240903) Issue happens with filtercode v2.6.0.

odelhaye commented 2 days ago

Same fatal error on Moodle 4.5 (Build: 20241007). Php 8.3.9.

michael-milette commented 2 days ago

Thank you for your contribution. The issue has been resolved and will be included in the next release of FilterCodes (which should be in a few minutes).

odelhaye commented 2 days ago

Ça fonctionne impec désormais. Merciii !