Zen Cart G2 Configuration error
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
I am recieving "Your Zen Cart installation is not in a subdirectory of Gallery" when attempting to configure Zen Cart in G2. I am using the 1.3.9g version of the Prepatched ZenCart fileset. My searchs of the forum shows that an update was done to ZC-G2 Bridge for this issue. This site is not in production, so all options are open for resolving this problem. I am have been working on integrating G2 and ZC for several days with at least 10 attempts (1st 5 or so attempts were my stupidity). I have been able to get G2 and ZC fully operational with separate installs, but have not gotten them talking yet. The issue may be due to me misunderstanding the install instructions. This is my first real venture in working with websites outside of some Frontpage junk I did 5 years ago, so I'm sorry if I am reading the instructions incorrectly. Thanks in advance phpinfo link = http://www.carlinosweb.com/gallery2/phpinfo.php Webhost is 1&1 Gallery URL = http://www.carlinosweb.com/gallery2/main.php |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Noted. Been wrestling with fixing this bug and it works on my system. I'll get back to you on this ... maybe I'll just disable the check. -- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Hi Dayo, Can you confirm that I still need to use the bridge even though I am using the prepacked ZC install from your site? Also, the following message is being generated in the g2_EventLogMap table when attempting to configure the Zencart module: Use of undefined constant __DIR__ - assumed '__DIR__' in file /homepages/17/d312440366/htdocs/gallery2/modules/zencart/AdminZenCart.inc on line 112";"Use of undefined constant __DIR__ - assumed '__DIR__' ) ) Thanks again |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
On with the files, bear in mind that we are talking about a bridge between two separate applications: ZC on one hand, and G2 on the other. To bridge them, some files have to be added to ZC and other files to G2. Due to the fact that the files that should go into ZC need to be placed in a number of different folders within ZC, I was getting people getting mixed up and having installation issues so I decided to get a copy of ZC, place the files in the right locations and put it up for download so that people can get this and just put the G2 files in place and get going. So yes, you still need to have the files for G2 as the codex outlines. On the error, thanks for posting the actual error message from the logs. I had just been getting complaints and never had the opportunity to check the logs. I had been as confused as hell since the code works just fine on my setup. Having seen the error message, it appears it is because you are not on PHP 5.3 (post link to phpinfo to confirm). If this is the case, then wait for a while and check for v3.3.2a. You don't need to change the prepatched zencart files. BTW, you must have nipped in within a short window as I only had 3.3.1c up for a little bit before updating it. Anyway, wait until the link on my site reads 3.3.2a and then download that set. Maybe I'll ultimately make the module PHP 5.3 only and set it up to refuse to install otherwise. This particular issue is minor though if it is just a case of the '__DIR__' magic constant causing the problem. Need the phpinfo to confirm. -- |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Confirmed that specific error is PHP 5.3 related. So go into gallery2/modules/zencart/AdminZenCart.inc on line 112 and change Let me know if that fixes the configuaration error so I can update the 3.3.2 files after which you should upgrade to 3.3.2a. -- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Thanks for the explanation. Here is the phpinfo link. phpinfo link = http://www.carlinosweb.com/gallery2/phpinfo.php Looks like 1&1 is on version 4.4.9. To test my understanding of my problem, G2 and ZC can run independently on PHP v4.4.9, but they can't talk to each other since the ZC integration module in G2 requires v5.3. Is this a correct? If correct, I either need to get 1&1 to upgrade to php 5.3, find a new web host, or find another gallery and/or cart solution. I realy appreciate your help with this. Nice to see I had a basic understanding of what I was doing |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
I copied and pasted the new code and I am still getting the same error. It does not appear that it is generating an error message in the EventLogMap table this time. John |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
I can send you a php file to place on your server and I'll need you to send me a link to that file. Please know that this file will give me full access to your webserver. You should ensure the file has been deleted, that I haven't sneaked another copy in and that you change any passwords after I am done. If you are comfortable with this, pm me your email address. -- |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
OK. A few things. You should not be having the error as everything looks fine on your site (noticed you actually had v3.3.2 which I have changed to read v3.3.2a) So, the code looks perfectly fine to me and perhaps the error you saw the second time is from a cache. Try clearing your browser cache and have another go. A few things of note:
Back to the issue at hand, I am sorry but I can't figure out why you should be having those errors. If all fails, you can disable the check by changing... $error[] = 'form[error][path][badDir]'; GalleryCoreApi::removePluginParameter('module', 'zencart', 'path'); to /* Disable folder consistency check */ //$error[] = 'form[error][path][badDir]'; //GalleryCoreApi::removePluginParameter('module', 'zencart', 'path'); ... in AdminZenCart.inc. -- |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
make that changing... if ($parentdir != $g2dir) { $error[] = 'form[error][path][badDir]'; GalleryCoreApi::removePluginParameter('module', 'zencart', 'path'); } else { to if ($form['path']) {
-- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
I cleared my cache but still no dice. Will try the disable option you suggested. I am not sure if this has any bearing on the problem, but I cannot get to ZC's admin module with the current install. All that appears is a blank page. During one of my prior troubleshooting attempts, I did a clean install of ZC from their download and was able to get to the admin page. I did confirm that the self destruct removed the file. I will post the results of disabling the checks. |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
I was able to get through the configuration. When attempting to activate, I received the following: Quote:
Error Detail - |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
OK a few things. On my site, I have just been able to create a test album and it was added to ZC as a category (where your install is falling down) without any issues. However, looking at the code in modules/zencart/classes/GalleryZenCart.class at line 865, I can see it doesn't make sense and will always crash (it is testing for a variable that has not been created before then). So there are a few queries to answer. I have gone back to the first version of the module as written by the original developer and that function has not changed from then. As it looks on the surface that the code should always crash at that point, I need to figure out why after several installations I have done over the years I have been working on this, I have yet to have a crash at that point. I have however not installed for a while (been editing existing files) so I will do so and see what gives. However the same code should run when adding a new album and I just did that successfully. Apart from this, you have an issue with you overall installation (blank page). I suggest you do the following Leave things alone at that while I look into this. I am afraid I can't say when I will be done but will try to get to the bottom of it ... starting by installing fresh copies of g2 and zc and seeing if I hit any issues trying to install the module. Gotta run. Good luck! -- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Will get started on this. Rather than just deleting ZC, I will blow away G2 and drop all db tables as well. With me poking around the install for several days, I might have messed something up by mistake and rule out any tinkering errors. Thanks |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Sounds like a good idea since you haven't yet put much on it. Give it about an hour or so while I repackage the ZC files to exclude the Mac stuff. -- |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Actually, I'll leave the repackaging till tomorrow and do it on the latest version of ZC (1.3.9h) so look out for the download link about 1900 GMT tomorrow. Goodnight! |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Will do. Thanks again. |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
v3.3.3 released which, together with the prepatched Zencart 1.3.9h files, should address these issues. On the ERROR_STORAGE_FAILURE issue, a review of the code shows that it is valid code and should not generate a crash in a properly installed G2. -- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Hi Dayo Any ideas? Quote:
4 6 PHP Error [Notice] Undefined index: bypass in file /homepages/17/d312440366/htdocs/gallery2/modules/zencart/classes/GalleryZenCart.class on line 1659 "Undefined index: bypass |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
That error is getting triggered by a check for the image firewall bypass module I use. I do this check so I don't have to write two versions of the code (for me and for public release). There is a quick fix but if you don't mind, I'll like to try out a catch all option for other that may have a similar setup as you have. In function makeThumbnailUrl of gallery2/modules/zencart/classes/GalleryZenCart.class, change ... if (isset($thumbnail[$itemId])) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret) { return array($ret, null); } if ($pluginStatus['bypass']['active'] == 0) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); } else { /* bypass image firewall process and return direct links to g2data */ to if (isset($thumbnail[$itemId])) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret) { return array($ret, null); } if (isset($pluginStatus['bypass']['active'])) { if ($pluginStatus['bypass']['active'] == 0) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); } } if (!isset($url)) { /* bypass image firewall process and return direct links to g2data */
-- |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
If that still crashes, then change your function makeThumbnailUrl to ... function makeThumbnailUrl($itemId) { global $gallery; list ($ret, $thumbnail) = GalleryCoreApi::fetchThumbnailsByItemIds(array($itemId)); if ($ret) { return array($ret, null); } if (isset($thumbnail[$itemId])) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); $urlParts = parse_url($url); $zenPath = trim($this->_zenCart->getZenConstant('DIR_FS_CATALOG') . $this->_zenCart->getZenConstant('DIR_WS_IMAGES'), '/'); $relativeUrl = ''; /* Take it back to the root... */ foreach (explode('/', $zenPath) as $part) { $relativeUrl .= '../'; } /* ...and travel to the target from there. */ $url = rtrim($relativeUrl, '/') . $urlParts['path']; /* Add query string if not using URL rewrite. */ if (!empty($urlParts['query'])) { $url .= '?' . $urlParts['query']; } } else { $url = ''; } return array(null, $url); }
Let me know which one works out |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
WOOT!!!! Thank you so much for your contribution as well as your help in resolving this issue. John |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Nice. Glad the first one worked as that was the preferred option. Now, looking at your site, I see the thumbnails are not showing up on the ZC side. Are you sure you are using the prepatched Zencart 1.3.9h files? This should not be happening if the Zencart installation was from those files. Can you confirm? ***** EDIT**** Please change the fix from ... if (isset($thumbnail[$itemId])) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret) { return array($ret, null); } if (isset($pluginStatus['bypass']['active'])) { if ($pluginStatus['bypass']['active'] == 0) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); } } if (!isset($url)) { /* bypass image firewall process and return direct links to g2data */ to if (isset($thumbnail[$itemId])) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret) { return array($ret, null); } if (isset($pluginStatus['bypass']['active'])) { if ($pluginStatus['bypass']['active'] == 0) { $firewall = true; } } if ($firewall) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); } else { /* bypass image firewall process and return direct links to g2data */ Deactivate and reactivate the module to rebuild the thumbnail links. You may also want to go into module.inc and change -- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Thanks. I did notice the thumbnail issue. I will walk through your instructions (run queries, etc) and advise. URL Rewrite was activated prior to installing ZC. Thanks |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Ignore the queries ... see bug notice above. |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Hi Dayo, I activated and inactivated the module before and after. I also deleted the album and added new picts but still nothing. |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
This should finally sort it out ... if (isset($thumbnail[$itemId])) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret) { return array($ret, null); } if (isset($pluginStatus['bypass']['active'])) { if ($pluginStatus['bypass']['active'] == 0) { $firewall = true; } } else { $firewall = true; } if ($firewall) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); } else { /* bypass image firewall process and return direct links to g2data */
Been a bit lax with following the logic through |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Awesome. Works perfectly. |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Can you please test this more succinct version and let me know if it works? if (isset($thumbnail[$itemId])) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret) { return array($ret, null); } else if (isset($pluginStatus['bypass']['active'])) { $firewall = $pluginStatus['bypass']['active']; } if ($firewall) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); } else { /* bypass image firewall process and return direct links to g2data */
-- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Applied the new code, inactivated then reactivated. Thumbnails no longer appear in the cart. |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
OK. I would have expected the shorter one to also work but let's stick with the previous. Now, remember to change the module.inc to 3.3.3a as outlined earlier and edit the ZC look. I put a big "Designed by Dayo Akanji" there to motivate people but it seems many can't be bothered lol. Enjoy! -- |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
One final test if you don't mind ... if (isset($thumbnail[$itemId])) { list ($ret, $pluginStatus) = GalleryCoreApi::fetchPluginStatus('module'); if ($ret) { return array($ret, null); } elseif (isset($pluginStatus['bypass']['active'])) { $firewall = $pluginStatus['bypass']['active']; } if (!$firewall) { /* use default image firewall process */ $urlGenerator =& $gallery->getUrlGenerator(); $url = $urlGenerator->generateUrl( array('view' => 'core.DownloadItem', 'itemId' => $thumbnail[$itemId]->getId()), array('forceFullUrl' => true, 'forceSessionId' => false)); } else { /* bypass image firewall process and return direct links to g2data */ -- |
|
j_car
Joined: 2011-01-03
Posts: 15 |
![]() |
Works fine. |
|
Dayo
Joined: 2005-11-04
Posts: 1642 |
![]() |
Thanks. That's the pick. |
|