Vinai / groupscatalog2

Magento extension to enable you to hide categories and products from customers depending on their customer group. This is a Magento 1.6 and newer compatible version of the Netzarbeiter Customer Groups Catalog extension.
139 stars 60 forks source link

Migration tool shouldn't need old files to be present #1

Closed bdgeorge closed 12 years ago

bdgeorge commented 12 years ago

If the database is set up for groups catalog 1, but the groups catalog 1 files aren't present it would still be great if we could run the migration assistant.

This scenario happened to me after upgrading form 1.3 to 1.6, the cleanest upgrade path came from using a fresh install of 1.6 and then letting it up-rev the database - but of course this confuses the migration tool.

In this scenario $this->isGroupsCatalogInstallResourcePresent() returns true but $this->isGroupsCatalogInstalled() returns false.

So that means if you look at migration.phtml you will see most of the page content , but can't take any actions - and most of the actions are still perfectly applicable.

Perhaps if you added a method to Netzarbeiter_GroupsCatalog2_Block_Adminhtml_System_Tools_Migration like

public function areCatalog1FilesPreset(){ 
    /*
    Check if any of these exist
        'app/etc/modules/Netzarbeiter_GroupsCatalog.xml',
        'app/code/community/Netzarbeiter/GroupsCatalog/',
        'app/locale/de_DE/Netzarbeiter_GroupsCatalog.csv',
        'app/locale/en_US/Netzarbeiter_GroupsCatalog.csv',
        'app/locale/fr_FR/Netzarbeiter_GroupsCatalog.csv',
        'app/locale/nl_NL/Netzarbeiter_GroupsCatalog.csv'
    */
}

Then you could change the migration.phtml page to work more like a migration checklist showing either a tick or a button against each step.

Vinai commented 12 years ago

Good point, thanks for the input.
My objective was to make the migration as fool proof as possible. The only way to check for each of the different states was to also use files. Maybe there could be an "Enable advanced mode" checkbox which allows the admin to freely select the step to execute?

bdgeorge commented 12 years ago

That could work, something like this perhaps? https://gist.github.com/2027795 That's a quick mockup only - completely non-functional! The idea being that each row independently checks all of it's preconditions, so you no longer have to sequentially track through it. Rows would never disappear, they would just enable/disable the button and change the status colour/message. When all steps are complete no buttons will be enabled and everything will be green.

I can't help but feel it could all be done with one UI though, or even just as part of the module setup script - it's so close already ;-)

Vinai commented 12 years ago

Hi again. I just came to the conclusion that since my time is so limited, I'll won't be able to implement this. If you feel like stepping up and completing it I'd be happy to pull a patch. The reason is the migration tool will be used less and less anyway, the longer the extension exists. I'd rather use the time to fix other issues or improve general features.

bdgeorge commented 12 years ago

Fair enough! I'll send a patch if it's something I use again as well.