? Success

User tests: Successful: Unsuccessful:

avatar phproberto
phproberto
3 Mar 2015

Description

We should never define a constant without checking if it's defined. When trying to use views to process the routes for their own view in my component I found that the component helper is called twice and then it's trying to define a constant that has been already defined.

Backward compatibility

There is no issue here. Just using the recommended way of doing things. Everything should work.

Test

Apply the patch and ensure that components are working properly.

avatar phproberto phproberto - open - 3 Mar 2015
avatar joomla-cms-bot joomla-cms-bot - change - 3 Mar 2015
Labels Added: ?
avatar n9iels
n9iels - comment - 3 Mar 2015

Code looks good to me. I have no problems with using components on front and backend


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6273.
avatar n9iels n9iels - test_item - 3 Mar 2015 - Tested successfully
avatar zero-24 zero-24 - change - 4 Mar 2015
Easy No Yes
avatar zero-24 zero-24 - change - 7 Mar 2015
Category Code style Libraries
avatar bembelimen
bembelimen - comment - 14 Mar 2015

Perhaps we should use a shorthand version:

defined('JPATH_COMPONENT') or define('JPATH_COMPONENT', JPATH_BASE . '/components/' . $option);

Otherwise:
@test works

avatar brianteeman brianteeman - alter_testresult - 14 Mar 2015 - bembelimen: Tested successfully
avatar brianteeman brianteeman - change - 14 Mar 2015
Status Pending Ready to Commit
avatar brianteeman
brianteeman - comment - 14 Mar 2015

Setting RTC


This comment was created with the J!Tracker Application at issues.joomla.org/joomla-cms/6273.
avatar brianteeman brianteeman - change - 14 Mar 2015
Labels Added: ?
avatar mbabker
mbabker - comment - 14 Mar 2015

Putting the JPATH_COMPONENT_ADMINISTRATOR define onto a single line makes it too long for our code style rules (and I tried a couple of tricks), so for now I'll leave this as is so it's at least consistent and merge. Thanks!

avatar zero-24 zero-24 - close - 14 Mar 2015
avatar mbabker mbabker - change - 14 Mar 2015
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2015-03-14 14:59:35
avatar mbabker mbabker - close - 14 Mar 2015
avatar mbabker mbabker - reference | - 14 Mar 15
avatar mbabker mbabker - merge - 14 Mar 2015
avatar mbabker mbabker - close - 14 Mar 2015
avatar zero-24 zero-24 - change - 14 Oct 2015
Labels Removed: ?

Add a Comment

Login with GitHub to post a comment