Details
-
Type: Task
-
Status: Done/Fixed
-
Priority: Minor
-
Resolution: Won't Fix
-
Affects Version/s: 3.3.alpha
-
Fix Version/s: 4.3.0
-
Component/s: Core CiviCRM
-
Labels:None
Description
In http://forum.civicrm.org/index.php/topic,14674.0.html I proposed an overhaul of the URL-generating code parts to get rid of some weaknesses. As an outcome of the discussion I'm creating this bug to keep track of the patches. Some of them are rather small and harmless others go beyond simple refactoring and do change the behavior slightly. Here is what I got so far:
These patches should be rather safe:
- http://gitorious.org/civicrm/civicrm-torotil/commit/15628a5a312f1fc703c2f8a549177afb575ca51c „remove barely used functions: makeURL and getLinksUrl": these functions are only used twice. Each usage is replaced by a simpler construct that uses System::url instead.
- http://gitorious.org/civicrm/civicrm-torotil/commit/3920b935c9d619e84d1db25f30f8153be096eff9 „replace calls to eval with factory/singleton like pattern": avoids the eval-calls in System. It shouldn't change the behavior whatsoever. The placement of the call do CRM_Utils_System::init is still open for discussion though. I didn't really know where to place it. It has to be before the first use of any call to System and after Config is at least partially initialized.
- http://gitorious.org/civicrm/civicrm-torotil/commit/10822ab5ba80cb8a4cfc036bc9a59494bfd8faf5 „Simplify CRM_Utils_System_Drupal::url()": Greatly simplify System_Drupal::url. Though it changes the behavior a bit it should be safe.
Rather safe but needs additional testing:
- http://gitorious.org/civicrm/civicrm-torotil/commit/aad8d77b73364d7d567eeff233cd5e8de7c910dd „remove/mark some unused functions": There are still some functions in System that seem to be completely unused (not mentioned in any other PHP-file). I removed some of them and commented out others. For me everything works still fine, but I didn't test everything.
Still needs some work:
- http://gitorious.org/civicrm/civicrm-torotil/commit/4d15f4cf2b1fd0a712ab08d77e995c5fd0fa0896 „replace url generation for drupal with a more generic approach.": This introduces an new way of generating URLs, which is more object oriented.
NOTE: Now that standalone is being dropped, we really should look into relying more one $uf for all this. This could save us a lot of code and work. I'm currently not planning on creating a joomla-testinstallation, so I'm not able to check the joomla-side of this matter.