-
☆ A M B ☆
- 83 Posts
Hello to everyone!
I'm making a new extra component in MODx. I follow all the step about how to making transport package and I made my firstextra-1.0.0-rc1.transport.zip.
As tutorial about Package Managament say:
So, an example Transport Package might be "myextra-1.0-rc1.transport.zip". If you were to upload a "myextra-1.0-rc2.transport.zip", MODx would then interpret this as part of the same "package" but a newer version of it. It would then behave in "upgrade" mode.
Now a newer version (firstextra-1.0.0-rc2.transport.zip) is available but when I upload my packages in MODx I can only make a NEW INSTALL instead of UPGRADE.
Anyone know where is my fault?
Thank in advice. Francesco
How do you know that it's not upgrading the components in the package? Is it creating duplicates of the objects?
Does the rc2 version show as a separate package in Package Manager?
BTW, you might look at the MyComponent extra, though it may be overkill if it's a simple package, but it will make sure the package has all the things it should have (e.g., license, readme.txt, etc.) and puts all the files in the right places and the objects in their categories.
-
☆ A M B ☆
- 83 Posts
Quote from: BobRay at Sep 03, 2015, 01:48 AMHow do you know that it's not upgrading the components in the package? Is it creating duplicates of the objects?
I know because there's a switcher inside the setupoption.resolver.php:
switch ($options[xPDOTransport::PACKAGE_ACTION]) {
case xPDOTransport::ACTION_UPGRADE:
$success= true;
break;
case xPDOTransport::ACTION_INSTALL:
$settings = array(
'appID',
'appSecret',
);
foreach ($settings as $key) {
if (isset($options[$key])) {
$setting = $object->xpdo->getObject('modSystemSetting',array('key' => 'projects.'.$key));
if ($setting != null) {
$setting->set('value',$options[$key]);
$setting->save();
} else {
$object->xpdo->log(xPDO::LOG_LEVEL_ERROR,'[Projects] '.$key.' setting could not be found, so the setting could not be changed.');
}
}
}
$success= true;
break;
Quote from: BobRay at Sep 03, 2015, 01:48 AM
Does the rc2 version show as a separate package in Package Manager?
Yes it is. see attachment.
I don't know if this is the cause of your problem, but I've had trouble with numbered rc versions. I just had a big mess with a widget extra when I added an rc2 version. At one point, I had 4 copies of the widget installed from upgrading the package.
When I switched from 1.0.1-rc and 1.0.1-rc2 to 1.0.1-rc and 1.0.2-rc, it solved all my problems. I think it's a bug in Package Manager.