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
Fix 1.6 -> 1.7 migration ; add a few class stubs #6531
Conversation
jocel1
commented
Sep 29, 2016
•
edited
edited
Questions | Answers |
---|---|
Branch? | develop |
Description? | Move a few Install files into PrestaShopBundle/Install; Add stubs for core classes & add an Adapter namespace around core classes; Properly create sf database based on entities, properly migrate the admin theme |
Type? | bug fix |
Category? | IN |
BC breaks? | no |
Deprecations? | no |
Fixed ticket? | Could have a positive impact on BOOM-1451 (not tested yet) |
How to test? | Install a 1.6.1.x shop, then upgrade to 1.7.x codebase, and run upgrade.php |
eval('abstract class AbstractLogger extends AbstractLoggerCore{}'); | ||
require_once(_PS_INSTALL_PATH_.'upgrade/classes/FileLogger.php'); | ||
eval('class FileLogger extends FileLoggerCore{}'); | ||
|
||
$cacheDir = _PS_ROOT_DIR_.'/'.(_PS_MODE_DEV_ ? 'dev' : 'prod').'/log/'; | ||
@mkdir($cacheDir, 0777, true); | ||
$logger = new FileLogger(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is FileLogger
now? I dont see any use
and it seems deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was already loaded in classes/log/AbstractLogger.php, same for FileLoggerCore.php
@@ -882,6 +882,8 @@ public static function checkAndAddLanguage($iso_code, $lang_pack = false, $only_ | |||
} | |||
} | |||
|
|||
self::loadLanguages(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain why you add this? I guess there is a good reason but I don't get it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you add a new language through checkAndAddLanguage, it will not update the local cache. Hence If you're using getLanguages() just after adding a language with checkAndAddLanguage(), the new language will not be returned.
034c6a9
to
231473e
Compare
e4285c9
to
8a5202f
Compare
*/ | ||
public function processNextStep() | ||
{ | ||
} | ||
|
||
public function display() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why this empty method?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because it now implements HttpConfigureInterface and the function display() is mandatory
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, ok, so the interface is the problem, but not the subject of this PR.
|
||
ALTER TABLE `PREFIX_tab` ADD `icon` varchar(32) DEFAULT ''; | ||
|
||
/* PHP:migrate_tabs_17(); */; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please be careful of the new lines
@@ -34,6 +34,60 @@ | |||
$engineType = 'ENGINE_TYPE'; | |||
define('PS_IN_UPGRADE', 1); | |||
|
|||
$incompatibleModules = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure that this array should be here…
Right now it might works, but only for 1.6 to 1.7. If for the 1.8 we re-add a module named … blockcms for example, this module will be on the ignored list.
This script, I think, is called only one time when you upgrade.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first I wanted to be able to fetch the information from the addons api, but that's not easy. That's why I finally choose to put a hardcoded list of modules. But we could fix it properly later, once it'll be easy to fetch the compatibility info from the addons api, based on the module name.
@@ -66,6 +120,9 @@ | |||
|
|||
require_once(INSTALL_PATH . 'install_version.php'); | |||
|
|||
// remove old unsupported classes | |||
@unlink(__DIR__.'/../../../classes/db/MySQL.php'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait … The Autoupgrade module doesn't remove the files?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add least the manual execution of upgrade.php doesn't :)
8a5202f
to
e5f7e09
Compare
Hello @jocel1 Moreover, I install an 1.6.1.7, make the 1.7.0.0 sql script, and I had some differences, I don't know if it's normal, but just to say. Present in 1.7 and not in 1.6.1.7 with 1.7.0.0.sql
In 1.6.1.7 with 1.7.0.0.sql but not in 1.7.0.0 clean install
|
I think the missing tables are fixed by this PR : basically it's all the tables created by doctrine from symfony entities, and which wasn't properly handled by upgrade.php |
59d87ef
to
b09c7d4
Compare
CO : Add stubs for core classes & add an Adapter namespace around core classes IN : Properly create sf database based on entities, properly migrate the admin theme
eb89db7
to
a19a802
Compare
Red build is a false alert. I checked locally. Thanks Jocelyn! |