In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
55 [In-Portal CMS] Optimization task always 2009-06-08 07:27 2012-07-25 05:33
alex  
alex  
normal  
closed 5.1.0  
fixed  
 
none 5.2.0-B1  
1
0000055: Get rid of safeDefine function usage when possible
Currently we use "safeDefine" function instead of "define". Function "safeDefine" doesn't define constant if it was previously defined to prevent fatal error. Later this function was globally used due integration issues with old kernel. Now, when it's gone we should revise usage of this function.
There should be explanation provided for every safeDefine replaced by define.
patch safedefine_to_define_55.patch (2,397) 2011-09-28 07:25
http://tracker.in-portal.org/file_download.php?file_id=1161&type=bug
patch safedefine_to_define_55.2.patch (875) 2011-10-04 05:38
http://tracker.in-portal.org/file_download.php?file_id=1198&type=bug
Issue History
2012-07-25 05:33 alex Note Added: 0005107
2012-07-25 05:33 alex Status resolved => closed
2011-10-22 05:30 alex Estimate Points => 1
2011-10-05 09:18 alex Changeset attached 5.2.x r14640
2011-10-05 09:18 alex Note Added: 0004024
2011-10-05 09:18 alex Status reviewed and tested => resolved
2011-10-05 09:18 alex Fixed in Version => 5.2.0-B1
2011-10-05 09:18 alex Resolution open => fixed
2011-10-05 09:18 alex Assigned To !COMMUNITY => alex
2011-10-05 09:18 alex Summary Get rid of safeDefine function usage when possible. => Get rid of safeDefine function usage when possible
2011-10-05 09:18 alex Assigned To alex => !COMMUNITY
2011-10-05 09:18 alex Status needs testing => reviewed and tested
2011-10-04 05:38 erik Note Added: 0003997
2011-10-04 05:38 erik Assigned To erik => alex
2011-10-04 05:38 erik Status needs work => needs testing
2011-10-04 05:38 erik File Added: safedefine_to_define_55.2.patch
2011-10-03 12:48 alex Note Added: 0003982
2011-10-03 12:48 alex Assigned To alex => erik
2011-10-03 12:48 alex Status needs testing => needs work
2011-09-28 07:28 erik Note Added: 0003933
2011-09-28 07:28 erik Assigned To erik => alex
2011-09-28 07:28 erik Developer => erik
2011-09-28 07:28 erik Status needs work => needs testing
2011-09-28 07:28 erik Time Estimate Removed 1 =>
2011-09-28 07:25 erik File Added: safedefine_to_define_55.patch
2011-09-27 04:10 alex Time Estimate Added 1
2011-09-27 04:10 alex Note Added: 0003915
2011-09-26 04:22 alex Additional Information Updated bug_revision_view_page.php?rev_id=843#r843
2011-09-24 05:22 alex Note Added: 0003894
2011-09-23 21:47 Dmitry Assigned To => erik
2011-09-23 21:47 Dmitry Status active => needs work
2011-09-23 21:47 Dmitry Target Version Icebox => 5.2.0
2010-08-31 14:12 alex version => 5.1.0
2010-06-10 13:48 alex Target Version 5.2.x => Icebox
2009-10-06 14:27 alex Type bug report => task
2009-06-09 10:49 Dmitry Target Version => 5.2.x
2009-06-08 07:27 alex New Issue

Notes
(0003894)
alex   
2011-09-24 05:22   
Maybe this was already done. Needs to be checked.
(0003915)
alex   
2011-09-27 04:10   
I've searched for kUtil::safeDefine method usages and found 19 of them. And ~5 of them are worth changing. Other occurrences can stay.
(0003933)
erik   
2011-09-28 07:28   
Patch attached - needs testing
(0003982)
alex   
2011-10-03 12:48   
Review of changed places:
1. // user can't edit anything. Not safeDefine - Run() can't be called twice
Run can't be called twice but searching for EDITING_MODE constant in this method reveals, that it can be defined before safeDefine method call (when using browse modes on front-end) resulting a PHP Warning

2. // no need for safeDefine - this tag can't be twice on page
Tag InitCacheUpdater can't be called twice, but safeDefine here is placed to allow developers to increase cache update step size from "modules/custom/constants.php" file

3. same here, your fix prevents ability for developer to override that constants

4. these constants should be moved away into "core/kernel/constants.php" file
(0003997)
erik   
2011-10-04 05:38   
safedefine_to_define_55.2.patch attached - needs testing
(0004024)
alex   
2011-10-05 09:18   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0000055: Get rid of safeDefine function usage when possible
Commit on behalf of Erik
(0005107)
alex   
2012-07-25 05:33   
Since 5.2.0 version was released.