In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1441 [In-Portal CMS] Optimization bug report always 2012-11-11 23:42 2012-12-04 03:53
Dmitry  
alex  
normal  
resolved 5.2.0  
fixed  
 
none 5.2.1-B2  
https://groups.google.com/d/topic/in-portal-bugs/e3BqcErYvfw/discussion
Separated Module Installation with Class Constants in Unit Config
1
0001441: Separate Module Installation with Class Constants in Unit Config
When doing separate module installation, then it's "constants.php" file isn't included during Application initialization because module isn't installed yet.

This creates Fatal Error in case if classes defined in "constants.php" are used inside unit configs of this not yet installed module.

As a solution I'm proposing to add these lines:
$constants_file = FULL_PATH . '/' . $module_folder . '/constants.php';

if ( file_exists($constants_file) ) {
    require_once $constants_file;
}

after these lines:
include_once(FULL_PATH . '/core/kernel/startup.php');
require_once FULL_PATH . '/core/install/install_toolkit.php';

in each module's install.php file.
patch installation_constants_1441_modules.patch (3,214) 2012-12-03 09:40
http://tracker.in-portal.org/file_download.php?file_id=1872&type=bug
patch installation_constants_modules_v2.patch (19,214) 2012-12-04 03:48
http://tracker.in-portal.org/file_download.php?file_id=1876&type=bug
Issue History
2012-12-04 03:53 alex Note Added: 0005311
2012-12-04 03:53 alex Status reviewed and tested => resolved
2012-12-04 03:53 alex Fixed in Version => 5.2.1-B2
2012-12-04 03:53 alex Resolution open => fixed
2012-12-04 03:53 alex Changeset attached 5.2.x r15648
2012-12-04 03:52 alex Changeset attached 5.2.x r15647
2012-12-04 03:52 alex Changeset attached 5.2.x r15646
2012-12-04 03:52 alex Changeset attached 5.2.x r15645
2012-12-04 03:52 alex Changeset attached 5.2.x r15644
2012-12-04 03:52 alex Changeset attached 1.2.x r15643
2012-12-04 03:50 alex Status needs testing => reviewed and tested
2012-12-04 03:50 alex Note Added: 0005310
2012-12-04 03:48 alex File Added: installation_constants_modules_v2.patch
2012-12-03 09:41 erik Note Added: 0005303
2012-12-03 09:41 erik Assigned To => alex
2012-12-03 09:41 erik Developer => erik
2012-12-03 09:41 erik Status active => needs testing
2012-12-03 09:40 erik File Added: installation_constants_1441_modules.patch
2012-11-11 23:42 Dmitry Estimate Points 0 => 1
2012-11-11 23:42 Dmitry New Issue
2012-11-11 23:42 Dmitry Reference => https://groups.google.com/d/topic/in-portal-bugs/e3BqcErYvfw/discussion
2012-11-11 23:42 Dmitry Change Log Message => Separated Module Installation with Class Constants in Unit Config
2012-11-11 23:42 Dmitry Estimate Points => 0

Notes
(0005303)
erik   
2012-12-03 09:41   
Patch attached. Needs testing
(0005310)
alex   
2012-12-04 03:50   
File "installation_constants_modules_v2.patch" just has reformatted code.
(0005311)
alex   
2012-12-04 03:53   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001441: Separate Module Installation with Class Constants in Unit Config