Follow us on Twitter X-Cart on Facebook Wiki
Shopping cart software Solutions for online shops and malls

Changing Versions for Custom Modules

 
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)
 
Thread Tools Search this Thread
  #1  
Old 03-26-2015, 11:02 AM
  zychen's Avatar 
zychen zychen is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 48
 

Question 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
__________________
X-Cart 5.1.10
X-Cart Next 5.2.1 Beta
Reply With Quote
  #2  
Old 03-26-2015, 11:22 AM
 
tony1100 tony1100 is offline
 

Advanced Member
  
Join Date: Oct 2012
Posts: 31
 

Default Re: Changing Versions for Custom Modules

same problem here
__________________
Tony
Reply With Quote
  #3  
Old 03-27-2015, 07:20 AM
 
tony1100 tony1100 is offline
 

Advanced Member
  
Join Date: Oct 2012
Posts: 31
 

Default Re: Changing Versions for Custom Modules

try change the version to 5.2 in your main.php under customers module
__________________
Tony
Reply With Quote
  #4  
Old 03-27-2015, 09:07 AM
  zychen's Avatar 
zychen zychen is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 48
 

Default 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.
__________________
X-Cart 5.1.10
X-Cart Next 5.2.1 Beta
Reply With Quote
  #5  
Old 03-27-2015, 12:45 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
zychen (03-30-2015)
  #6  
Old 03-30-2015, 03:53 AM
  zychen's Avatar 
zychen zychen is offline
 

Advanced Member
  
Join Date: Jul 2007
Posts: 48
 

Unhappy 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.
__________________
X-Cart 5.1.10
X-Cart Next 5.2.1 Beta
Reply With Quote
  #7  
Old 03-30-2015, 04:53 PM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote

The following user thanks totaltec for this useful post:
zychen (03-31-2015)
  #8  
Old 03-30-2015, 06:36 PM
  cflsystems's Avatar 
cflsystems cflsystems is offline
 

Veteran
  
Join Date: Apr 2007
Posts: 14,190
 

Default 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.
__________________
Steve Stoyanov
CFLSystems.com
Web Development
Reply With Quote

The following 3 users thank cflsystems for this useful post:
iClerisy (03-31-2015), totaltec (03-31-2015), zychen (03-31-2015)
  #9  
Old 03-31-2015, 08:45 AM
  totaltec's Avatar 
totaltec totaltec is offline
 

X-Guru
  
Join Date: Jan 2007
Location: Louisville, KY USA
Posts: 5,823
 

Default 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.
__________________
Mike White - Now Accepting new clients and projects! Work with the best, get a US based development team for just $125 an hour. Call 1-502-773-6454, email mike at babymonkeystudios.com, or skype b8bym0nkey

XcartGuru
X-cart Tutorials | X-cart 5 Tutorials

Check out the responsive template for X-cart.
Reply With Quote
  #10  
Old 04-01-2015, 01:27 AM
  qualiteam's Avatar 
qualiteam qualiteam is offline
 

X-Guru
  
Join Date: Dec 2010
Posts: 6,373
 

Default 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...
__________________
Alex Solovev,
Qualiteam

---

User manual Video tutorials X-Cart FAQ

You are welcome to press "Thanks" button
if you find this post useful

Click here to learn how to apply patches

X-Cart Extensions

Last edited by qualiteam : 04-01-2015 at 01:29 AM.
Reply With Quote

The following user thanks qualiteam for this useful post:
totaltec (04-01-2015)
Reply
   X-Cart forums > X-Cart 5 > Dev Questions (X-Cart 5)


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -8. The time now is 05:20 AM.

   

 
X-Cart forums © 2001-2020