Error in the creation of a new Learning path
Current behavior / Resultado actual / Résultat actuel
Php error in the creation of a new Learning path
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
You need to update chamilo with the latest code in 1.11.x Also execute a composer update

Error still occurs.
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',
try also doing a git checkout of 1.11.x
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.
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).
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
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.
Interesting! Thanks for that.
Can be closed now.