Closed toanhminh0412 closed 1 year ago
I found a fix for this:
After migrating the app folder from core to app, the first 3 require_once
lines of /com_courses/models/gradepolicies.php are importing files from the core folder. Make sure to change these 3 to import from the app folder. Then the component should work as expected.
Here is what I have in my new file: Change from
require_once PATH_CORE . DS . 'components' . DS . 'com_courses' . DS . 'tables' . DS . 'grade.policies.php';
require_once PATH_CORE . DS . 'components' . DS . 'com_courses' . DS . 'models' . DS . 'offering.php';
require_once PATH_CORE . DS . 'components' . DS . 'com_courses' . DS . 'models' . DS . 'section.php';
to
require_once dirname(__DIR__) . DS . 'tables' . DS . 'grade.policies.php';
require_once dirname(__DIR__) . DS . 'models' . DS . 'offering.php';
require_once dirname(__DIR__) . DS . 'models' . DS . 'section.php';
Bug Description
Moving com_courses from core to app produces a 500 error
Reproducibility
Starting with the HubZero code given with the VM, paste and app overlay code over the starting code. Simply move com_courses from core to app. It will produce a 500 error "Cannot redeclare class Components\Courses\Tables\Role" when accessing
/courses
.For bugs with fixers: How was the code fixed? No fixes so far
Environment
Additional Context (optional)
When I tried to move com_courses from core to app, I get an PHP 500 error: "Cannot redeclare class Components\Courses\Tables\Role"