User tests: Successful: Unsuccessful:
Because I think it is a bug i changed
defined('JPATH_BASE') or die;
into
defined('_JEXEC') or die;
Code review.
See #28417 for all other folders
Status | New | ⇒ | Pending |
Category | ⇒ | Layout |
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.
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?
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?
Labels |
Added:
?
|
@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 (
joomla-cms/tests/unit/bootstrap.php
Line 26 in e381b1a
JPATH_BASE
is also set here . But for another reason.
But maybe I'm missing something?
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
Thanks everybody for your time on this!
Awesome thanks for the quick feedback on this one @phproberto
I have tested this item
Code review.
I have tested this item
Status | Pending | ⇒ | Fixed in Code Base |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-03-24 22:22:36 |
Closed_By | ⇒ | zero-24 |
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.
Institutional memory is very important
I don't know what's wrong or right. Probably just for reference ;-)
#8398