X-Cart: shopping cart software

X-Cart forums (https://forum.x-cart.com/index.php)
-   Dev Questions (X-Cart 5) (https://forum.x-cart.com/forumdisplay.php?f=56)
-   -   Changing Versions for Custom Modules (https://forum.x-cart.com/showthread.php?t=71704)

zychen 03-26-2015 11:02 AM

Changing Versions for Custom Modules
 
Hi everyone,

So I was upgrading to XC 5.2 but I have a few custom modules that I included for 5.1.x

Since my modules are not on the marketplace, I have to disable them then upgrade.

The problem comes when my custom module has added entities and attributes to the MySQL tables. My data already has values for these added columns so I am getting an error when rebuilding my cache if I disable some of my custom modules.

The question is how do I make it so that I can have that "Upgrade this module to the latest version" option like the other third-party modules for my own custom one so that they do not have to be disabled at all upon upgrade?

P.S. Assume that my custom code is 100% compatible with the new version already.


-Niboon

tony1100 03-26-2015 11:22 AM

Re: Changing Versions for Custom Modules
 
same problem here

tony1100 03-27-2015 07:20 AM

Re: Changing Versions for Custom Modules
 
try change the version to 5.2 in your main.php under customers module

zychen 03-27-2015 09:07 AM

Re: Changing Versions for Custom Modules
 
The problem is that the module would be disabled first then there would be an error because X-Cart cannot rebuild the MySQL tables with the data in the additional fields.

totaltec 03-27-2015 12:45 PM

Re: Changing Versions for Custom Modules
 
Niboon,
The only way to have the upgrade available for your modules is if they are listed in the marketplace. At least it is the only way that I know of.

To overcome your problem, have you tried enabling your module directly in the database, right before cache is rebuilt during upgrade process?

After downloading updates?

I have gotten this to work before, I struggled with this when going from 5.0 to 5.1.
But I can't remember the exact steps I took or I would provide more detail.

zychen 03-30-2015 03:53 AM

Re: Changing Versions for Custom Modules
 
Hi Mike,

I did not try that, I definitely would give it a try the next time round, thanks. Unfortunately, I had to re-import all my data again after deleting them to upgrade.

So it seems like a common problem with XC5 customization then?

That's unfortunate, I hope they find a way around this restriction soon because otherwise it really defeats the purpose of having XC5 to be modular and upgradable.
It would very likely affect the number of people who renew their upgrade subscriptions too so they should take this pretty seriously.

totaltec 03-30-2015 04:53 PM

Re: Changing Versions for Custom Modules
 
Quote:

Originally Posted by totaltec
To overcome your problem, have you tried enabling your module directly in the database, right before cache is rebuilt during upgrade process?

I can't seem to do this myself. This is a major problem for anyone running custom modules, and all of my clients are running custom modules of course.

The listed solution is to publish these modules in the marketplace so that upgrade packs can be provided, but this obviously will not work for custom skins and business specific logic, some of which is proprietary!

We need a step by step process we can follow, and I have yet to come up with one.

cflsystems 03-30-2015 06:36 PM

Re: Changing Versions for Custom Modules
 
I just saw this thread. This is major limitation which basically means start with 5.2.x from scratch which is unacceptable. Not to mention some user have already paid new subscription so they can upgrade to 5.2.,x and now they can't.

So now the main selling point of XC5 over XC4 runs down the drain. And reading all the other threads about all the problems this upgrade has just makes me sad...

When modules and core are downloaded for an upgrade they are downloaded to /var/tmp directory with name like this

/var/tmp/974648368.gz

Now probably somewhere in db there is a cache or similar table with relation what's what but did you try to put your custom module in /var/tmp with some name like that - of course make sure it is gz archive - and see if it works.

totaltec 03-31-2015 08:45 AM

Re: Changing Versions for Custom Modules
 
Quote:

Originally Posted by cflsystems
So now the main selling point of XC5 over XC4 runs down the drain. And reading all the other threads about all the problems this upgrade has just makes me sad...

Me too. You all know that I try to keep positive as much as possible, but after my experiences last night trying to upgrade some of my test sites, I am really struggling to maintain that positive outlook.

qualiteam 04-01-2015 01:27 AM

Re: Changing Versions for Custom Modules
 
Hi guys,

In case you have custom modules the flow is as follows:
1. Disable custom modules. It doesn't remove data from the database.
2. Upgrade X-Cart 5 and modules from marketplace.
3. Fix custom modules.
4. Enable custom modules back.

"Fix custom modules" - this depends on changes between the X-Cart versions that you are upgrading from/to AND on the module. For simple modules changing the value returned by getMajorVersion() method (in the module's Main.php file) will likely be enough.

Quote:

Originally Posted by zychen
The problem is that the module would be disabled first then there would be an error because X-Cart cannot rebuild the MySQL tables with the data in the additional fields.


There should be no error. Did you guess there, or have you tried this and faced the error?

----

As for upgrade problems. Don't forget that this is a major update, like from 4.0.x to 4.1.x. The changes in the code are huge, and some of them require modules to be updated to get in the line with the new classes/methods/functions/templates...


All times are GMT -8. The time now is 04:29 AM.

Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.