-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[4.1] Fix the upgrade path #36585
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.1] Fix the upgrade path #36585
Changes from 9 commits
acb2f98
77ae2cc
18b2f17
075f797
172d057
84c17cd
5d671e6
c372b47
3bf7f17
541456d
ca3738f
3b754cd
454de07
bc357f9
2ff1dfc
73b97af
f77dfc4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -99,6 +99,9 @@ public function update($installer) | |
| $this->deleteUnexistingFiles(); | ||
| $this->updateManifestCaches(); | ||
| $this->updateDatabase(); | ||
|
|
||
| // Ensure templates are moved to the correct mode | ||
| $this->fixTemplateMode(); | ||
| $this->updateAssets($installer); | ||
| $this->clearStatsCache(); | ||
| $this->convertTablesToUtf8mb4(true); | ||
|
|
@@ -8533,4 +8536,40 @@ protected function moveRemainingTemplateFiles() | |
| } | ||
| } | ||
| } | ||
|
|
||
| /** | ||
| * Ensure the core templates are correctly moved to the new mode. | ||
| * | ||
| * @return void | ||
| * | ||
| * @since __DEPLOY_VERSION__ | ||
| */ | ||
| protected function fixTemplateMode() | ||
| { | ||
| $db = Factory::getDbo(); | ||
dgrammatiko marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
|
|
||
| array_map( | ||
This comment was marked as abuse.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. functional programming? No real reason, it's a bit shorter
This comment was marked as abuse.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Don't believe everything you find on the internet :) FWIW browsers (JS) are optimizing for these functions and I would expect PHP would be doing that as well but for PHP I don't have any data... Edit: actually this comment aligns with what I wrote ;)
This comment was marked as abuse.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Functional programming is very popular in the JS space and the reason is because React, Vue, Svelte, etc basically made the UI a function of the state
This comment was marked as abuse.
Sorry, something went wrong. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I hate that I can't use the spread operator yet...
This comment was marked as abuse.
Sorry, something went wrong. |
||
| function ($template) use ($db) | ||
| { | ||
| $clientId = $template === 'atum' ? 1 : 0; | ||
| $query = $db->getQuery(true) | ||
| ->update($db->quoteName('#__template_styles')) | ||
| ->set($db->quoteName('inheritable') . ' = 1') | ||
| ->where($db->quoteName('template') . ' = ' . $db->quote($template)) | ||
| ->where($db->quoteName('client_id') . ' = ' . $clientId); | ||
|
|
||
| try | ||
| { | ||
| $db->setQuery($query)->execute(); | ||
| } | ||
| catch (Exception $e) | ||
| { | ||
| echo Text::sprintf('JLIB_DATABASE_ERROR_FUNCTION_FAILED', $e->getCode(), $e->getMessage()) . '<br>'; | ||
|
|
||
| return; | ||
| } | ||
| }, | ||
| ['atum', 'cassiopeia'] | ||
| ); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.