? Pending

User tests: Successful: Unsuccessful:

avatar astridx
astridx
21 Mar 2020

Summary of Changes

Because I think it is a bug i changed
defined('JPATH_BASE') or die;
into
defined('_JEXEC') or die;

Testing Instructions

Code review.

See #28417 for all other folders

avatar astridx astridx - open - 21 Mar 2020
avatar astridx astridx - change - 21 Mar 2020
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 21 Mar 2020
Category Layout
avatar astridx astridx - change - 21 Mar 2020
The description was changed
avatar astridx astridx - edited - 21 Mar 2020
avatar ReLater
ReLater - comment - 21 Mar 2020

I don't know what's wrong or right. Probably just for reference ;-)
#8398

avatar Bakual
Bakual - comment - 22 Mar 2020

Since I merged the referenced one back then: I think I merged it just so we use the same in all layouts. This doesn't necessary mean it's "right".
Maybe @zero-24 remembers why we used JPATH_BASE then? Personally I don't see a reason to use a different constant than _JEXEC anywhere. So this PR would be fine.

avatar zero-24
zero-24 - comment - 22 Mar 2020

hmm I said back then JPATH_BASE is the correct one but i can't remember why. I'm sure it was a thing we discussed in the maintainers chat back then and we maybe did it because the most where jPath_base in the first place. Maybe @phproberto has an idea on this?

avatar chmst
chmst - comment - 22 Mar 2020

The only what I remember is, that there is a difference between backend and frontend. They are applications of their own. Maybe this makes a difference?

avatar astridx astridx - change - 22 Mar 2020
Labels Added: ?
avatar astridx
astridx - comment - 22 Mar 2020

@ReLater I don't know what's wrong or right.

I also don't know what's wrong or right.
I think that JPATH_BASE is also set everywhere. But: I once learned that _JEXEC has the function to mark a secure entry point into Joomla! (https://docs.joomla.org/JEXEC). That's why I find it confusing when something else is used.

JPATH_BASE actually has a different function (The path to the installed Joomla! site, or JPATH_ROOT/administrator if executed from the back end; https://docs.joomla.org/Constants).

It could also lead to errors. For example, _JEXEC is set in the tests (

define('_JEXEC', 1);
). JPATH_BASE is also set here . But for another reason.

But maybe I'm missing something?

avatar phproberto
phproberto - comment - 24 Mar 2020

I think using _JEXEC is fine and better. Probably the initial JLayout included the JPAH_BASE and then it was spread.

For me _JEXEC is better because it's what is already being used and requested to extension developers in modules, views, etc. Same rule applied everywhere and less confusing.

Layout tests should be ok because both constants exist in the test suite.

It's a ? from me.

Thanks everybody for your time on this!

avatar zero-24
zero-24 - comment - 24 Mar 2020

Awesome thanks for the quick feedback on this one @phproberto

avatar ReLater
ReLater - comment - 24 Mar 2020

I have tested this item successfully on 4c90028

Code review.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28416.
avatar ReLater ReLater - test_item - 24 Mar 2020 - Tested successfully
avatar Quy
Quy - comment - 24 Mar 2020

I have tested this item successfully on 70da436


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/28416.

avatar Quy Quy - test_item - 24 Mar 2020 - Tested successfully
avatar zero-24
zero-24 - comment - 24 Mar 2020

merging thanks @astridx ?

avatar zero-24 zero-24 - change - 24 Mar 2020
Status Pending Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2020-03-24 22:22:36
Closed_By zero-24
avatar zero-24 zero-24 - close - 24 Mar 2020
avatar zero-24 zero-24 - merge - 24 Mar 2020
avatar Paladin
Paladin - comment - 4 May 2020

As an Old Phart (tm) my memory may not be the most reliable, but to chime in on @zero-24's comment I think this dates back into the dawning ages of the layouts. The discussion he almost remembers, I think, was over differentiating between the different purposes of the two constants, JEXEC marking the full CMS was present and executing, while JPATH_BASE merely indicating the Joomla files were present and available, not necessarily the CMS, thus enabling the layouts to work in applications outside of the CMS.

That doesn't seem to be an important consideration these days, and this isn't tossed in to say the change is wrong. I'm just contributing some extra memories so something else doesn't get completely lost in the haze of the past.

avatar brianteeman
brianteeman - comment - 4 May 2020

Institutional memory is very important

avatar zero-24
zero-24 - comment - 4 May 2020

Thanks for your input @Paladin :-)

Add a Comment

Login with GitHub to post a comment