In-Portal Issue Tracker - In-Portal CMS
Viewing Issue Advanced Details
1005 [In-Portal CMS] Refactoring bug report always 2011-02-21 13:15 2012-07-25 05:33
Dmitry  
alex  
normal  
closed 5.1.1  
fixed  
 
none 5.2.0-B1  
https://groups.google.com/d/topic/in-portal-bugs/z2jWbtWoKzA/discussion
Fixes detection of BASE_PATH in cron
1
0001005: Incorrectly Detected BASE_PATH in Cron
In some cases when we are building URLs from Cron (when Web-server environment is not available) we are getting incorrect URLs as a result.

We need to move Site_Path variable from ConfigurationValues table to config.php file. So, when we detect that script is not run under web-server (via command line), we SHOULD use this value as BASE_PATH constant.

Also "Site_Path" will be renamed to WebsitePath.
parent of 0001286closed  (5.2.0)alex CKEditor/FCKEditor not loading, when website is deployed on live 
related to 0000849closed  (5.1.1)alex Link, created from cron always use "localhost" instead of site url 
related to 0001289closed  (5.2.0)alex Incorrect link are build from cron 
child of 0000969closed  (5.2.0)alex New "System Configuration" installation step 
patch base_path_1005.patch (5,389) 2011-10-17 10:40
http://tracker.in-portal.org/file_download.php?file_id=1250&type=bug
patch base_path_1005.2.patch (11,499) 2011-10-21 05:37
http://tracker.in-portal.org/file_download.php?file_id=1263&type=bug
patch base_path_modules_1005.2.patch (613) 2011-10-21 05:38
http://tracker.in-portal.org/file_download.php?file_id=1264&type=bug
patch base_path_core_v3.patch (19,854) 2011-10-25 08:35
http://tracker.in-portal.org/file_download.php?file_id=1268&type=bug
patch base_path_modules_v3.patch (13,265) 2011-10-25 08:35
http://tracker.in-portal.org/file_download.php?file_id=1269&type=bug
Issue History
2012-07-25 05:33 alex Note Added: 0005074
2012-07-25 05:33 alex Status resolved => closed
2012-05-17 04:59 alex Relationship added related to 0001289
2012-05-17 04:58 alex Relationship added related to 0000849
2012-05-17 03:42 alex Relationship added parent of 0001286
2011-10-25 08:44 alex Changeset attached 5.2.x r14692
2011-10-25 08:44 alex Note Added: 0004087
2011-10-25 08:44 alex Status reviewed and tested => resolved
2011-10-25 08:44 alex Fixed in Version => 5.2.0-B1
2011-10-25 08:44 alex Resolution open => fixed
2011-10-25 08:44 alex Assigned To !COMMUNITY => alex
2011-10-25 08:43 alex Changeset attached 5.2.x r14691
2011-10-25 08:43 alex Changeset attached 5.2.x r14690
2011-10-25 08:43 alex Changeset attached 5.2.x r14689
2011-10-25 08:42 alex Changeset attached 5.2.x r14688
2011-10-25 08:42 alex Changeset attached 5.2.x r14687
2011-10-25 08:41 alex Changeset attached 1.2.x r14686
2011-10-25 08:36 alex Note Added: 0004086
2011-10-25 08:36 alex Assigned To alex => !COMMUNITY
2011-10-25 08:36 alex Status needs testing => reviewed and tested
2011-10-25 08:35 alex File Added: base_path_modules_v3.patch
2011-10-25 08:35 alex File Added: base_path_core_v3.patch
2011-10-22 05:25 alex Estimate Points => 1
2011-10-21 05:43 erik Note Added: 0004081
2011-10-21 05:43 erik Assigned To erik => alex
2011-10-21 05:43 erik Status needs work => needs testing
2011-10-21 05:38 erik File Added: base_path_modules_1005.2.patch
2011-10-21 05:37 erik File Added: base_path_1005.2.patch
2011-10-19 04:14 alex Note Added: 0004076
2011-10-19 04:14 alex Assigned To alex => erik
2011-10-19 04:14 alex Status needs testing => needs work
2011-10-17 10:40 erik Time Estimate Removed 1 =>
2011-10-17 10:40 erik Note Added: 0004063
2011-10-17 10:40 erik Assigned To erik => alex
2011-10-17 10:40 erik Developer => erik
2011-10-17 10:40 erik Status needs work => needs testing
2011-10-17 10:40 erik File Added: base_path_1005.patch
2011-10-14 02:42 alex Assigned To => erik
2011-10-14 02:42 alex Status active => needs work
2011-09-26 05:06 alex Time Estimate Added 1
2011-02-21 13:16 Dmitry Relationship added child of 0000969
2011-02-21 13:15 Dmitry New Issue
2011-02-21 13:15 Dmitry Reference => https://groups.google.com/d/topic/in-portal-bugs/z2jWbtWoKzA/discussion
2011-02-21 13:15 Dmitry Change Log Message => Fixes detection of BASE_PATH in cron

Notes
(0004063)
erik   
2011-10-17 10:40   
patch attached - needs testing
(0004076)
alex   
2011-10-19 04:14   
1. Not all usages of "Site_Path" configuration variable were transformed (please search through all code of all modules, that are available in "in-portal.full" checkout. There must be separate patches for
- In-Portal changes (...._core.patch)
- In-Portal module changes (...._modules.patch)
- In-Portal theme changes (...._themes.patch)

2. Please set WebsitePath into config.php at the beginning (e.g. where WriteablePath & RestrictedPath are set).

3. Please adjust DisplayOrder of all configuration variables in same sub-section where "Site_Path" configuration variable was (this can be done with a single UPDATE sql). Right now they start from 10.02 and not from 10.01 as they should.

4. Usage of WebsitePath setting in startup.php doesn't make sense, since you check if it's present then use it and it's always present. While in task description there was written, that WebsitePath should be used as BASE_PATH only, when In-Portal is invoked from command line.

5. It's also unclear to me, why you have removed rtrim(..., '/') around BASE_PATH usage in kApplication::BaseURL method, especially since both old Site_Path config variable and new WebsitePath setting have "/" at the end.


----

For parts, where I haven't get the idea about the changed code you can explain it here or revert it to original state.
(0004081)
erik   
2011-10-21 05:43   
1) attached new patches, included patch for modules, in the themes variable Site_Path not found - needs testing

2) Problematically, because BASE_PATH constant is not defined on this step.
3) Done
4) Done - changed logic
5) rtrim removed, because rtrim is already used on BASE_PATH constant definition, so BASE_PATH value is always "rtrimmed".



(0004086)
alex   
2011-10-25 08:36   
Following bugs were found & fixed:
1. no upgrade script, so running cron from command line would fail after upgrade

Following optimizations were made:
1. constant BASE_PATH looks, like former "Site_Path" config variable (except of trailing "/"), so I've decided to use WariablesPath value instead of detecting BASE_PATH value on every script run
2. because of no need for auto-detection constant REL_PATH was removed from all places, except installator itself.
(0004087)
alex   
2011-10-25 08:44   
Fix committed to 5.2.x branch. Commit Message:

Fixes 0001005: Incorrectly Detected BASE_PATH in Cron
Commit on behalf of Erik
(0005074)
alex   
2012-07-25 05:33   
Since 5.2.0 version was released.