5.4.0.3, Plain Yogurt: Editing the expected header.php file has no effect

Permalink
I couldn't understand why editing /concrete/themes/default/elements/header.php had no effect on the site.

Editing /updates/concrete5.4.0.3/concrete/themes/default/elements/header.php updates the site instead.

Is this the intended behavior?

 
mose replied on at Permalink Reply
mose
Probably. What does config/site.php say your current core is?
deckeda replied on at Permalink Reply
I don't have that file inside /update/concrete5.4.0.3

But the file inside the root /config directory has:

<?php define('DIRNAME_APP_UPDATED', 'concrete5.4.0.3');?>


This begs the question of what purpose does the /concrete directory serve? I know I can't delete it, but since the site seems to pulling some files from /updates instead, this is getting confusing FAST.
mose replied on at Permalink Best Answer Reply
mose
It appears that you missed the information about how updates now work in 5.4. You might want to spend some quality time browsing the forums to catch up on things. A few extra minutes might save you time and alert you to new features.

When an update takes place, it no longer replaces the core directory. Instead, it installs a new core directory alongside of the old core directory, and it defines a constant in config/site.php to indicate the current core directory.

If there is ever a problem with an upgrade, you can simply modify or delete DIRNAME_APP_UPDATED, and you are instantly back to where you were. If any database changes occurred as part of the upgrade, you would need to restore the database, as well, of course. It's always a good idea to backup the database before an update, even if the update doesn't involve database changes.

That being said, you should never modify any core files, because the next update will replace them, as you have already tested. Instead, copy the files to the top-level directories and modify the copies. That's why the top-level directories are there. They allow you to override the core functionality without changing the core code.

In this case, copy <root>/concrete/themes/default/elements/header.php to <root>/themes/default/elements/header.php. Change the header file in the local themes directory.
deckeda replied on at Permalink Reply
Thanks very much, mose. That explains it now. You're right, I didn't find any of what you mention when I looked.