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.
One confusing part of the instructions http://codex.gallery2.org/Gallery2:Modules:zencart) refers to the upload of the module files (step 1 in "Then, in Gallery 2"). Using the Prepatched Zencart 1.3.9g, I do not see the module files to load into my Gallery2 modules folder. I have copied the Zencart module from the ZC-G2 Bridge 3.3.1c (filename shows 3.3.2)into the Gallery2\modules folder. Was this what was implied?
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
John
phpinfo link = http://www.carlinosweb.com/gallery2/phpinfo.php
Webhost is 1&1
Gallery URL = http://www.carlinosweb.com/gallery2/main.php
Gallery version = 2.3.1 core 1.3.0.1
API = Core 7.54, Module 3.9, Theme 2.6, Embed 1.5
PHP version = 4.4.9 cgi
Webserver = Apache
Database = mysqlt 5.0.91-log, lock.system=flock
Toolkits = ArchiveUpload, Exif, Getid3, jpegtran, LinkItemToolkit, NetPBM, Thumbnail, Gd
Acceleration = none, none
Operating system = Linux infong 2.4 #1 SMP Tue Dec 18 22:34:10 UTC 2007 i686 GNU/Linux
Default theme = matrix
gettext = enabled
Locale = en_US
Browser = Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.0.3705; .NET CLR 1.1.4322; Media Center PC 4.0; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30; .NET CLR 3.0.04506.648; .NET CLR 3.5.21022; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729; .NET4.0C; .NET4.0E)
Rows in GalleryAccessMap table = 50
Rows in GalleryAccessSubscriberMap table = 6
Rows in GalleryUser table = 2
Rows in GalleryItem table = 4
Rows in GalleryAlbumItem table = 2
Rows in GalleryCacheMap table = 0
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.
--
dakanji.com
Posts: 15
Hi Dayo,
Thanks for the quick response.
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__'
Request variables: Array
(
[return] => /gallery2/main.php?g2_view=core.SiteAdmin&g2_subView=zencart.AdminZenCart
[formUrl] => /gallery2/main.php?g2_view=core.SiteAdmin&g2_subView=zencart.AdminZenCart
[authToken] => 580e2dbd830c
[controller] => zencart.AdminZenCart
[form] => Array
(
[formName] => AdminZenCart
[path] => /homepages/17/d312440366/htdocs/gallery2/store
[action] => Array
(
[save] => Save
)
)
)
Thanks again
John
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.
--
dakanji.com
Posts: 1642
Confirmed that specific error is PHP 5.3 related.
So go into gallery2/modules/zencart/AdminZenCart.inc on line 112 and change
$g2dir = substr(__DIR__, 0, -16);
to$g2dir = substr(dirname(__FILE__), 0, -16);
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.
--
dakanji.com
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
John
Posts: 1642
Just apply the edit I posted above and you should be fine.
Let me know how it goes.
--
dakanji.com
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
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.
Basically, I'll be able to see and manipulate anything on your webserver php has access to.
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.
--
dakanji.com
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)
I uploaded a file to your zencart module folder and if you navigate to it at http://www.carlinosweb.com/gallery2/modules/zencart/pathtest.php, you will see that it confirms that your ZC's parent directory is that same as your G2 location. The code run by that file is the same as in AdminZenCart.inc where it does the checks.
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...
to
... in AdminZenCart.inc.
--
dakanji.com
Posts: 1642
make that changing...
to
--
dakanji.com
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.
Other items appreciated and noted. I will be clean up once I work through this problem.
I will post the results of disabling the checks.
Posts: 15
I was able to get through the configuration. When attempting to activate, I received the following:
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
1. delete the zc module from within your g2 admin
2. Drop the zc database, delete your zc folder, grab a copy of the prepatched fileset (sorry about the ._xyz files) and reinstall zencart. Once that is done, just leave it alone ... well you can busy yourself deleting the ._xyz files.
3. use the script attached here to search your G2 db for any references to zencart and delete them using phpmyadmin
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!
--
dakanji.com
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
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.
--
dakanji.com
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!
--
dakanji.com
Posts: 15
Will do. Thanks again.
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.
--
dakanji.com
Posts: 15
Hi Dayo
I did a complete reinstall of both Gallery and ZC using the prepackaged files. All went perfectly until I reached the Activate Module step in Gallery Admin. Clicking activate does nothing. The following error is generated in the g2_EventLogMap table
Any ideas?
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 definitely something screwy going on with your installation as that should not be triggering an error. I ran the installation on a fresh G2 install (without the bypass module) several times yesterday.
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 ...
to
--
dakanji.com
Posts: 1642
If that still crashes, then change your function makeThumbnailUrl to ...
Let me know which one works out
--
dakanji.com
Posts: 15
WOOT!!!!
1st one worked!!!
Thank you so much for your contribution as well as your help in resolving this issue.
John
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****
There is a bug in the code fix which is breaking your thumbnails.
Please change the fix from ...
to
Deactivate and reactivate the module to rebuild the thumbnail links.
You may also want to go into module.inc and change
$this->setVersion('3.3.3');
to$this->setVersion('3.3.3a');
afterwards--
dakanji.com
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.
I downloaded the 1.3.9h from your site yesterday.
Thanks
John
Posts: 1642
Ignore the queries ... see bug notice above.
--
dakanji.com
Posts: 15
Hi Dayo,
I changed the code but the thumbbails are still not appearing in the cart.
I activated and inactivated the module before and after. I also deleted the album and added new picts but still nothing.
Posts: 1642
This should finally sort it out ...
Been a bit lax with following the logic through
--
dakanji.com
Posts: 15
Awesome. Works perfectly.
Playing around with it now.
Thanks again for everything.
Posts: 1642
Can you please test this more succinct version and let me know if it works?
--
dakanji.com
Posts: 15
Applied the new code, inactivated then reactivated. Thumbnails no longer appear in the cart.
Changed back to the working version, inactivated then reactivated, and they now work.
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!
--
dakanji.com
Posts: 1642
One final test if you don't mind ...
--
dakanji.com
Posts: 15
Works fine.
Posts: 1642
Thanks. That's the pick.
--
dakanji.com