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

"Check for Upgrades" Button in the Magento Connect Manager does not work after Installation of Groupscatalog2 #47

Open jjwhatever opened 11 years ago

jjwhatever commented 11 years ago

Hi,

got the following problem: After Installation of your extension Customer Groups Catalog2 via the Magento Connect Manager, I cant see any "yellow marked" upgradable extensions (see also attached images first Pic). If I deinstall your extension everything is fine again (pic nr.2). How does your extension suppress this kind of messages?

Pic:1 magento_connect_after_extension_installation

Pic:2 magento_connect_prio_extension_installation

Vinai commented 11 years ago

Hi,

thanks for your report. I assume you are using Magento 1.7.0.2?

To be honest, I have no idea how that can happen. The extension is packaged using the regular Magento packaging interface in the store admin, and uploaded regularly to Magento Connect. There is no code that does anything even remotely related to the downloader/installer. If I have an idea, I'll look into it for sure. If you find out anything, please let me know.

jjwhatever commented 11 years ago

Correct I am using Magento 1.7.0.2 .. currently I dont have any idea where to look... maybe I will check again the log-files.

jjwhatever commented 11 years ago

I checked some log-files and deinstalled and reinstalled Groupscatalog x-times. The only log entry that I found was this one:

a:5:{i:0;s:100:"Invalid backend model specified: netzarbeiter_groupscatalog2/entity_attribute_backend_customergroups";i:1;s:6037:"#0 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Eav/Model/Entity/Attribute/Abstract.php(346): Mage::exception('Mage_Eav', 'Invalid backend...')
#1 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Eav/Model/Entity/Abstract.php(640): Mage_Eav_Model_Entity_Attribute_Abstract->getBackend()
#2 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Eav/Model/Entity/Abstract.php(1624): Mage_Eav_Model_Entity_Abstract->walkAttributes('backend/afterLo...', Array)
#3 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Eav/Model/Entity/Abstract.php(964): Mage_Eav_Model_Entity_Abstract->_afterLoad(Object(Mage_Catalog_Model_Category))
#4 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Catalog/Model/Resource/Abstract.php(698): Mage_Eav_Model_Entity_Abstract->load(Object(Mage_Catalog_Model_Category), '2', NULL)
#5 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Model/Abstract.php(225): Mage_Catalog_Model_Resource_Abstract->load(Object(Mage_Catalog_Model_Category), '2', NULL)
#6 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Catalog/Model/Layer.php(167): Mage_Core_Model_Abstract->load('2')
#7 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Catalog/Block/Navigation.php(346): Mage_Catalog_Model_Layer->getCurrentCategory()
#8 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Catalog/Block/Navigation.php(145): Mage_Catalog_Block_Navigation->getCurrentCategory()
#9 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Catalog/Block/Navigation.php(250): Mage_Catalog_Block_Navigation->isCategoryActive(Object(Varien_Data_Tree_Node))
#10 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Catalog/Block/Navigation.php(441): Mage_Catalog_Block_Navigation->_renderCategoryMenuItemHtml(Object(Varien_Data_Tree_Node), 0, false, true, true, 'level-top', '', true)
#11 /usr/www/users/koksen/shop-abn2/app/design/frontend/base/default/template/catalog/navigation/top.phtml(42): Mage_Catalog_Block_Navigation->renderCategoriesMenuHtml(0, 'level-top')
#12 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(241): include('/usr/www/users/...')
#13 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/base/d...')
#14 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#15 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#16 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Text/List.php(43): Mage_Core_Block_Abstract->toHtml()
#17 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Text_List->_toHtml()
#18 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#19 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('topMenu', true)
#20 /usr/www/users/koksen/shop-abn2/app/design/frontend/default/theme253/template/page/html/header.phtml(50): Mage_Core_Block_Abstract->getChildHtml('topMenu')
#21 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(241): include('/usr/www/users/...')
#22 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#23 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#24 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#25 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(582): Mage_Core_Block_Abstract->toHtml()
#26 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(526): Mage_Core_Block_Abstract->_getChildHtml('header', true)
#27 /usr/www/users/koksen/shop-abn2/app/design/frontend/default/theme253/template/page/1column.phtml(42): Mage_Core_Block_Abstract->getChildHtml('header')
#28 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(241): include('/usr/www/users/...')
#29 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(272): Mage_Core_Block_Template->fetchView('frontend/defaul...')
#30 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Template.php(286): Mage_Core_Block_Template->renderView()
#31 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Block/Abstract.php(863): Mage_Core_Block_Template->_toHtml()
#32 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Model/Layout.php(555): Mage_Core_Block_Abstract->toHtml()
#33 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Controller/Varien/Action.php(390): Mage_Core_Model_Layout->getOutput()
#34 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Cms/Helper/Page.php(137): Mage_Core_Controller_Varien_Action->renderLayout()
#35 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Cms/Helper/Page.php(52): Mage_Cms_Helper_Page->_renderPage(Object(Mage_Cms_IndexController), 'home')
#36 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Cms/controllers/IndexController.php(45): Mage_Cms_Helper_Page->renderPage(Object(Mage_Cms_IndexController), 'home')
#37 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Controller/Varien/Action.php(419): Mage_Cms_IndexController->indexAction()
#38 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Controller/Varien/Router/Standard.php(250): Mage_Core_Controller_Varien_Action->dispatch('index')
#39 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Controller/Varien/Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#40 /usr/www/users/koksen/shop-abn2/app/code/core/Mage/Core/Model/App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#41 /usr/www/users/koksen/shop-abn2/app/Mage.php(683): Mage_Core_Model_App->run(Array)
#42 /usr/www/users/koksen/shop-abn2/index.php(87): Mage::run('', 'store')
#43 {main}";s:3:"url";s:11:"/shop-abn2/";s:11:"script_name";s:20:"/shop-abn2/index.php";s:4:"skin";s:7:"default";}

Hope this can help anyway... so far I do some more testing.

Vinai commented 11 years ago

Are you using the Magento Compiler? If so, please recompile after installing the extension and flushing the cache.

jjwhatever commented 11 years ago

I did not used the compiler before do you mean the compiler from: "System > Tools > Compiler"?. I tested it now with the compiler ... But I compiled and flushed the cache but nothing changed. Got still the same error message.

Vinai commented 11 years ago

Please check the file

app/code/community/Netzarbeiter/GroupsCatalog2/Model/Entity/Attribute/Backend/Customergroups.php

exists.

jjwhatever commented 11 years ago

Yes the file exists!

Vinai commented 11 years ago

That is the file the backend model points to. Could you please put the following test-script in a test.php file in the Magento root and call it via the browser, and then paste the output here?

<?php
umask(0);
require_once 'app/Mage.php';

Mage::app();
Mage::setIsDeveloperMode(true);

echo Mage::getConfig()
    ->getModelClassName('netzarbeiter_groupscatalog2/entity_attribute_backend_customergroups');
jjwhatever commented 11 years ago

This is the output from your script:

Netzarbeiter_GroupsCatalog2_Model_Entity_Attribute_Backend_Customergroups

Vinai commented 11 years ago

Thanks! The output means the configuration XML resolves correctly, and since the file exists, the exception with the invalid backend model must not be current. Which once again means no idea why the issue in the downloader happens.

Vinai commented 11 years ago

Since there is nothing I can do at this time to reproduce the problem I'm closing this issue.

jjwhatever commented 11 years ago

Even with the latest release of your extension (0.2.7) I got still the error. Why does not any other got the same issue? So for me the issue is not really closed.

Vinai commented 11 years ago

I think most people don't use the downloader at all, so it's not an issue for them. I personally haven't used the downloader in 3 or 4 years now, only in the very beginning after I started with Magento. That is the reason this is kind of a low priority - sorry. If there aren't any more urgent things I'll be happy to have a look though.

janihemanspice commented 11 years ago

I have installed above extension it works fine for me in CE 1.7.0.2 and allow me to upgrade via downloader Lib_Js_Prototype without issue and 2 other upgrades also show which is not stable as stable and fails on upgrade. I think if this is not related to extension issue and it may be magento update channel. Still i have just guessed and not sure about issue b'coz i haven't tried due to lack of time. Just putting my comment that may help both of you in any manner.

Vinai commented 11 years ago

@janihemanspice : Thanks for your comment @jjwhatever : What stability setting have you selected in the downloader preferences?

jjwhatever commented 11 years ago

Preferred State: Alpha

Vinai commented 11 years ago

Thanks for the update. Doesn't help me reproduce the issue though I'm afraid :(

jjwhatever commented 11 years ago

would it be helpful if I gave you access to our test system? I would send you the admin and ftp pw via mail. So you can do some more tests and researches? No worry everything is backed up.

Vinai commented 11 years ago

It certainly would be helpful, even though I don't have time this week to look into the issue. Do you have my email?

jjwhatever commented 11 years ago

yes got your e-mail adress... you will got an email from me

jjwhatever commented 11 years ago

Hi did you got my mail?

jjwhatever commented 10 years ago

fyi: even with the latest magento version 1.8.0.0 and the latest version of Groupscatalog2 0.3.1 the error still exists on my system. Maybe you got some time to fix this. thx

jecstore commented 10 years ago

Hi, I'm facing exactly the same issue. Is there any update on this? I have 1.8.1.0 Thank you in advance

jjwhatever commented 10 years ago

From my side not. As I already said I need to deinstall the Groupscatalog2 to see any new upgradable packages (marked yellow). Otherwise it will not work :(

dstauch commented 10 years ago

The reason for the broken upgrade/dowloader script is the wrong state of Version 0.1.1. This Version has state "dev" instead of "devel". A local hotfix is to change the file

/downloader/lib/Mage/Connect/Validator.php from

protected static $_stability = array(0=>'devel',1=>'alpha',2=>'beta',3=>'stable');

to

protected static $_stability = array(0=>'devel',1=>'alpha',2=>'beta',3=>'stable', 4=>'dev');

jjwhatever commented 10 years ago

Hi dstauch,

your are right. Your hotfix is working for me!

Thank you very much. Great :)

jecstore commented 10 years ago

Hello dstauch and jjwhatever,

I applied the hotfix, but did not fix my issue. Do you have any other workaround?

Vinai commented 10 years ago

Thanks for digging into that @dstauch. That old package was built (like all of the releases by the way) using the Magento backend wizard. If I download the 0.1.1 archive from Magento Connect and examine the package.xml file, the stability is listed as <stability>devel</stability>. Could you give me any more information where you found the invalid stability?

I'll try to contact people back at Magento and will try to get that ancient version of the package either fixed or, even better, removed, if I can.

dstauch commented 10 years ago

We had a little bit trouble with one Customer, so we investigated deeper into this issue. This link put me in the right direction:

http://system-administration.orditude.fr/category/magento/magento-connect/

To find the module with the wrong stability, we just put a var_dump after

$remotePackages = $restObj->getPackagesHashed();

in /downloader/lib/Mage/Connect/Packager.php and run the "check for upgrades" on our LOCAL DEVELOPMENT SYSTEM.

see below:

class Mage_Connect_Packager { ...

/**
 * Get upgrades list
 *
 * @param string|array $channels
 * @param Mage_Connect_Singleconfig $cacheObject
 * @param Mage_Connect_Config $configObj
 * @param Mage_Connect_Rest $restObj optional
 * @param bool $checkConflicts
 * @return array
 */
public function getUpgradesList($channels, $cacheObject, $configObj, $restObj = null, $checkConflicts = false)
{
    if(is_scalar($channels)) {
        $channels = array($channels);
    }

    if(!$restObj) {
        $restObj = new Mage_Connect_Rest($configObj->protocol);
    }

    $updates = array();
    foreach ($channels as $chan) {

        if(!$cacheObject->isChannel($chan)) {
            continue;
        }
        $chanName = $cacheObject->chanName($chan);
        $localPackages = $cacheObject->getInstalledPackages($chanName);
        $localPackages = $localPackages[$chanName];

        if(!count($localPackages)) {
            continue;
        }

        $channel = $cacheObject->getChannel($chan);
        $uri = $channel[Mage_Connect_Singleconfig::K_URI];
        $restObj->setChannel($uri);
        $remotePackages = $restObj->getPackagesHashed();
        print '<pre>';
        var_dump($remotePackages);
        print '</pre>';
        /**
         * Iterate packages of channel $chan
         */
        $state = $configObj->preferred_state ? $configObj->preferred_state : "stable";

        foreach ($localPackages as $localName=>$localData) {
            if(!isset($remotePackages[$localName])) {
                continue;
            }
            $package = $remotePackages[$localName];
            $neededToUpgrade = false;
            $remoteVersion = $localVersion = trim($localData[Mage_Connect_Singleconfig::K_VER]);
            foreach ($package as $version => $s) {

                if($cacheObject->compareStabilities($s, $state) < 0) {
                    continue;
                }

                if(version_compare($version, $localVersion, ">")) {
                    $neededToUpgrade = true;
                    $remoteVersion = $version;
                }

                if($checkConflicts) {
                    $conflicts = $cacheObject->hasConflicts($chanName, $localName, $remoteVersion);
                    if(false !== $conflicts) {
                        $neededToUpgrade = false;
                    }
                }
            }
            if(!$neededToUpgrade) {
                continue;
            }
            if(!isset($updates[$chanName])) {
                $updates[$chanName] = array();
            }
            $updates[$chanName][$localName] = array("from"=>$localVersion, "to"=>$remoteVersion);
        }
    }
    return $updates;
}

...

}

Now, search for Netzarbeiter_GroupsCatalog2 and you will find:

["Netzarbeiter_GroupsCatalog2"]=> array(2) { ["0.1.1"]=> string(3) "dev" ["0.3.4"]=> string(4) "beta" }

ATTENTION: Don't do this on production systems!

nohart commented 10 years ago

Thank you so much dstauch! I am so grateful for your fix. Somewhere along the way my Magento Connect Manager got broken and wouldn't show any updates either. But it does now! I was having to manually check and upgrade each file for about the last 2 years. I have looked everywhere for a fix! Thanks again :-)

dstauch commented 10 years ago

Note: The hotfix is overwritten when you upgrade the Magento Core!

nohart commented 10 years ago

Well that's my next plan now is to figure how to best upgrade to 1.9 I'm on v1.7.0.2 I have read where some have done it through Magento Connect Manager but I am really not sure the best method to take...

Vinai commented 10 years ago

The issue is that the old 0.1.1 extension has the "dev" stability in the Magento Connect database. Its not part of the extension. There is nothing I can do myself to fix this issue. I'm trying to get Magento to change the value on their side, but who knows if that will happen. Thanks again for figuring this out though!

nohart commented 10 years ago

Understood, I just appreciate people like you because if you didn't at least engage in conversation about this a fix may not have come about! This is the only thing I have been able to find that shows how to fix this problem and I have been looking for about 2 years. I also use your Attribute Duplicator extension and I want to thank you for that too :-)

aarti6495 commented 8 years ago

hi

aarti6495 commented 8 years ago

I want to upgrade magento 1.6.0.2 to 1.9.1.1 so what can i do?

aarti6495 commented 8 years ago

I have go to mage all latest option via magento connect manager but it getting the error:-

Package community/Mage_Core_Modules 1.9.1.1 conflicts with: community/Magento_Mobile 1.6.0.0.22.1 Unsupported resource type Unsupported resource type Unsupported resource type Package community/Lib_Varien 1.9.1.1 conflicts with: community/Mage_Core_Modules 1.6.2.0 Package community/Lib_Google_Checkout 1.9.1.1 conflicts with: community/Mage_Core_Modules 1.6.2.0 Unsupported resource type Package community/Lib_Js_Mage 1.9.1.1 conflicts with: community/Mage_Core_Modules 1.6.2.0 Package community/Mage_Locale_en_US 1.9.1.1 conflicts with: community/Mage_Core_Modules 1.6.2.0 Package community/Lib_Mage 1.9.1.1 conflicts with: community/Mage_Core_Modules 1.6.2.0 Unsupported resource type Unsupported resource type Unsupported resource type Package community/Lib_ZF 1.12.7.0 conflicts with: community/Lib_Varien 1.6.1.0 Unsupported resource type Package community/Lib_ZF_Locale 1.12.7.0 conflicts with: community/Lib_ZF 1.11.1.0

Vinai commented 8 years ago

Hi @aarti6495 , this is not the right place to ask for Magento upgrade help. Please use the magento stack exchange site or the official Magento forums.