chamilo-lms icon indicating copy to clipboard operation
chamilo-lms copied to clipboard

Error in the creation of a new Learning path

Open rafatga opened this issue 9 years ago • 10 comments

Current behavior / Resultado actual / Résultat actuel

Php error in the creation of a new Learning path

1 2 3

Expected behavior / Resultado esperado / Résultat attendu

Step 1 Learning path

Steps to reproduce / Pasos para reproducir / Étapes pour reproduire

admin > courses > selected course > Learning path > new Learning path

Chamilo Version / Versión de Chamilo / Version de Chamilo

1.11.x

rafatga avatar Feb 20 '17 09:02 rafatga

You need to update chamilo with the latest code in 1.11.x Also execute a composer update

jmontoyaa avatar Feb 22 '17 07:02 jmontoyaa

screen shot 2017-02-22 at 9 31 41 am

screen shot 2017-02-22 at 9 29 05 am 2

screen shot 2017-02-22 at 9 29 15 am

Error still occurs.

rafatga avatar Feb 22 '17 08:02 rafatga

Check if you have this file: main/inc/lib/formvalidator/Element/DatePicker.php

Check if the file is correctly added in the autoloader here:

vendor/composer/autoload_classmap.php

'DatePicker' => $baseDir . '/main/inc/lib/formvalidator/Element/DatePicker.php',

jmontoyaa avatar Feb 22 '17 09:02 jmontoyaa

try also doing a git checkout of 1.11.x

jmontoyaa avatar Feb 22 '17 09:02 jmontoyaa

Sometimes (when using development versions), composer mixes things up and deleting the whole vendor/ directory, then issuing a "composer update" again will do a cleaner job than just composer update.

ywarnier avatar Mar 22 '17 18:03 ywarnier

Just as an additional note (to avoid forgetting about that detail), this is MAMP, so on a Mac OSX. Maybe that's causing another dependency issue somewhere (not sure any composer-loaded lib has dependencies on that, but it might).

ywarnier avatar Apr 27 '17 15:04 ywarnier

Tested this on Linux and Mac+brew with apache and php7.1 and the datepicker error is repeatable.

Cause: the inc/lib/formvalidator/Element/DatePicker.php class can not be found by the vendor/composer/classloader.php ??

Dirty workaround until this is solved: add line in lp_add.php: require_once DIR.'/../inc/lib/formvalidator/Element/DatePicker.php'; // TEMP FIX

jderriks avatar Apr 28 '17 10:04 jderriks

Better workaround until the "compser update" or "composer dump-autoload" creates the right autoload files: edit and add these lines in vendor/composer files: autoload_classmap.php: 'DatePicker' => $baseDir . '/main/inc/lib/formvalidator/Element/DatePicker.php',

autoload_static.php: 'DatePicker' => __DIR__ . '/../..' . '/main/inc/lib/formvalidator/Element/DatePicker.php',

Somehow these are not allways created by composer.

jderriks avatar Apr 28 '17 22:04 jderriks

Interesting! Thanks for that.

ywarnier avatar Apr 28 '17 22:04 ywarnier

Can be closed now.

jderriks avatar Apr 29 '17 12:04 jderriks