Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
3. Looks like 1 file is missing for the merged files: [YOUR-ZEN-CART-FOLDER]/includes/templates/[YOUR-ACTIVE-TEMPLATE]/templates/tpl_modules_whats_new.php
Hi fjbern,
you will excuse if my questions / suggestions were possibly a bit too entry level for you, but now I see clearer, thanks.
The file tpl_modules_whats_new.php is not absolutely required, if you do not use this functionality. I see now that for some reason the file is not in the current distribution, so I will add it and upload a new archive. If you just want to continue now with installation quickly, you could delete or comment out the line no. 94
Code:
DIR_FS_CATALOG_TEMPLATES . $current_template . '/templates/tpl_modules_whats_new.php',
inside [YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php which checks for the presence of tpl_modules_whats_new.php.
Quote:
Originally Posted by
fjbern1943
So here is my initial question. Can I upload all the new files in the admin and includes directories without doing the file mods. I then would want to do the file mods individually to make sure they are working properly and not effecting the operation of my store.
I have done my best to develop BookX so it will change the shop files as little as possible and also make it fail gracefully, meaning that I believe you could just upload the extra Bookx files and run the install script and only then do the modifications by hand. Again I have not tried and tested this approach myself, so i can't guarantee that it will work.
Maybe this bit of info helps you:
Bookx does almost all its work by observing the notifier hooks already in the ZC files and then inserting extra code whenever these hooks are triggered. Unfortunately there are not so many hooks in ZC yet as would be needed by BookX, so the manual modifications are almost all simple additions of these notification hooks. They do not change ZC very much at all, so the only error i could see these modifications producing are syntax errors in case something went wrong during making the edits.
Hope you get on well with all this now,
p.
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
philou
Hi fjbern,
you will excuse if my questions / suggestions were possibly a bit too entry level for you, but now I see clearer, thanks.
The file tpl_modules_whats_new.php is not absolutely required, if you do not use this functionality. I see now that for some reason the file is not in the current distribution, so I will add it and upload a new archive. If you just want to continue now with installation quickly, you could delete or comment out the line no. 94
Code:
DIR_FS_CATALOG_TEMPLATES . $current_template . '/templates/tpl_modules_whats_new.php',
inside [YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php which checks for the presence of tpl_modules_whats_new.php.
I have done my best to develop BookX so it will change the shop files as little as possible and also make it fail gracefully, meaning that I believe you could just upload the extra Bookx files and run the install script and only then do the modifications by hand. Again I have not tried and tested this approach myself, so i can't guarantee that it will work.
Maybe this bit of info helps you:
Bookx does almost all its work by observing the notifier hooks already in the ZC files and then inserting extra code whenever these hooks are triggered. Unfortunately there are not so many hooks in ZC yet as would be needed by BookX, so the manual modifications are almost all simple additions of these notification hooks. They do not change ZC very much at all, so the only error i could see these modifications producing are syntax errors in case something went wrong during making the edits.
Hope you get on well with all this now,
p.
I uploaded all the admin and include files to my test site.
I got a 500 server error: HTTP 500 error
That's odd... Microsoft Edge can’t find this page
This page can’t be displayed, because this site’s server might be under maintenance or there could be a programming error.
Also under Tools/bookx tools it shows:
BookX is currently not installed.
•Reset BookX settngs to defaults. Missing configuration entries will be fixed. No products will be altered or deleted! (Please make a database backup before you proceed!)
•Install BookX. (Please make a database backup before you proceed!)
•Update BookX to new version. (Please make a database backup before you proceed!)
•Remove BookX from the Database. (Please make a database backup before you proceed!) All BookX products as well as authors, genres, publishers etc. will be deleted!
If I try to install BookX using this link I get the same error.
Here is my setup and the error message produced:
Using PHP Version - 5.3.29
ZEN CART Version 1.54
Mysql server version: 5.1.73
Web server
•Apache
•Database client version: libmysql - 5.1.73
•PHP extension: mysqli Documentation
MyDebug error:
[19-Aug-2015 07:05:34 America/Chicago] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 :: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct' ==> (as called by) /hsphere/local/home/christianstore/christianstore.biz/catalog/admins/includes/init_includes/init_product_type_bookx.php on line 903 <== in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/classes/db/mysql/query_factory.php on line 155
Of course nothing gets written to the database.
Help!
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
MyDebug error:
[19-Aug-2015 07:05:34 America/Chicago] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 :: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct' ==> (as called by) /hsphere/local/home/christianstore/christianstore.biz/catalog/admins/includes/init_includes/init_product_type_bookx.php on line 903 <== in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/classes/db/mysql/query_factory.php on line 155
Of course nothing gets written to the database.
Help!
If you have direct access to your MYSQL the you could run the query direvctly just to test (copied from your error statement above):
Code:
REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct')
See if that gives you a syntax error. If it does, then see below.
In the installation script on line 950 it reads:
Code:
$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct'");
There should be no single quotes around {$profile_ids->fields['profile_id']}, so if you feel okay with it then you could remove these and try installation again. I actually don't get a MYSQL error when I run this query here with quotes.
The line should read:
Code:
$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ({$profile_ids->fields['profile_id']}, 'bookxProduct'");
I don't see any other syntax problem with that statement and can only try later on to make clean install of 1.5.4. and run the script myself.
Best,
p.
Re: New add-on "product type book" for ZC 1.5
Actually I did your instructions backwards.
First I modified the file to remove the single quotes as instructed at got the same error message.
Then I ran the sql statement directly in MySQL using phpmyadmin and it did indeed modify the database by inserting the information in the admin_pages_to_profiles table.
But after that no change in the bookx mod????
What should I do next?
Re: New add-on "product type book" for ZC 1.5
We are still aiming to find the source of your error, installation of the module comes next.
BookX is not installing because there is a MYSQL error and the module is therefore not yet running. As long as the script hasn't run completely, BookX will not work. Apparently your browser reports the failure of the installation script as "500 server error / page not found" since no HTML page is returned to your browser by the aborted script execution. So this to me seems to be one the same incident.
I was puzzled that the DEBUG log reported a syntax error in this statement: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct')
since as you saw the MYSQL query executes fine when sent directly to the DB. Not being able to reproduce the error means I have currently no way to troubleshoot further.
Let me try and install a ZC 1.5.4 shop and then BookX and see if I can reproduce the problem you encounter to then be able to fix it. Otherwise we are just poking around in the dark. I won't get to that today unfortunately, I'll do my best to tackle that tomorrow and let you know as soon as I have something.
Best regards,
p.
Re: New add-on "product type book" for ZC 1.5
Hi fjbern,
I have now downloaded a fresh ZC 1.5.4 english-only distribution and installed it with a new database. Merged the Bookx files into the file tree in their respective locations, excluding the manual edits to certain existing ZC files for now. Used the URL http://[YOUR_ADMIN_BACKEND]?action=bookx_install and Bookx installed fine.
There were some warnings about missing language files for german, which really shouldn't happen on an english-only distribution, so I will fix that on next release.
One thing that puzzles me is this:
Quote:
Originally Posted by
fjbern1943
Also under Tools/bookx tools it shows:
BookX is currently not installed.
•Reset BookX settngs to defaults. Missing configuration entries will be fixed. No products will be altered or deleted! (Please make a database backup before you proceed!)
•Install BookX. (Please make a database backup before you proceed!)
•Update BookX to new version. (Please make a database backup before you proceed!)
•Remove BookX from the Database. (Please make a database backup before you proceed!) All BookX products as well as authors, genres, publishers etc. will be deleted!
If I try to install BookX using this link I get the same error.
In fact before Bookx is installed in the DB, there should be no "Bookx Tools" showing under the "Tools" menu, so I suspect you have a partial install of Bookx in your DB.
Do you have a means to reload a pre-Bookx database from backup? if you don't have that or have made other changes to DB since, then you could make a DB backup now and try the "BookX Tools" command "Remove BookX from the Database."
Since bookx is not working for you, I would think that the warning about what to do with products of type "BookX" has no relevance to you, meaning you should not have any products of type BookX in your DB. Anyway you will make a DB backup first before removing Bookx, so you shouldn't lose any data this way or another.
After removing Bookx from DB, there should be no more "Bookx Tools" menu in your admin.
You can immediately run the bookx_install via URL again after that and see if it installs correctly this time. If not, please try to preserve as much info as possible, e.g. any warnings the installation script outputs or any other errors. If I can't reproduce the error here, I can't really fix it :)
You can leave all PHP files as they are during this entire procedure. In fact the additional Bookx PHP files as well as any manual modifications mentioned in the Bookx installation instructions should not interfere with the operation of your shop whether Bookx is installed or not. The module "sees" that Bookx is not installed and shouldn't really throw any errors. This is another reason why I suspect you have a partial install of Bookx in your DB for some reason.
Let me know if this helps you along.
Regards,
p.
Re: New add-on "product type book" for ZC 1.5
First I want to thank you for your active participation in trying to solve my problem installing bookx.
I am regularly getting two error messages in my admin/logs directory, they are:
[23-Aug-2015 08:10:42 America/Chicago] PHP Fatal error: 1064:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1 :: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct' ==> (as called by) /hsphere/local/home/christianstore/christianstore.biz/catalog/admins/includes/init_includes/init_product_type_bookx.php on line 903 <== in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/classes/db/mysql/query_factory.php on line 155
and:
[19-Aug-2015 09:48:51 America/Chicago] PHP Warning: file_get_contents(): http:// wrapper is disabled in the server configuration by allow_url_fopen=0 in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/functions/plugin_support.php on line 38
[19-Aug-2015 09:48:51 America/Chicago] PHP Warning: file_get_contents(http://www.zen-cart.com/downloads.ph...heck&id=1495): failed to open stream: no suitable wrapper could be found in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/functions/plugin_support.php on line 38
[19-Aug-2015 09:48:51 America/Chicago] PHP Warning: in_array() expects parameter 2 to be array, null given in /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/functions/plugin_support.php on line 42
This second one is because fopen is disabled on the server for security reasons.
Also I noticed that if I try to do a update from the bookx tools menu I get this message:
This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/sideboxes/tpl_bookx_filters_select.php
Warning This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/templates/tpl_bookx_authors_list_default.php
Warning This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/templates/tpl_bookx_series_list_default.php
Warning This BookX file should only exist in the folder "template_default" , except if overrides have been made for this ZC shop. When updating the BookX plugin these overrides must be merged into a new copy of the file from folder "template_default": /hsphere/local/home/christianstore/christianstore.biz/catalog/includes/templates/responsive_sheffield_blue/templates/tpl_product_bookx_info_display.php
Even though these files are definitely in place under my responsive_sheffield_blue template directories.
Evidence is that if you go to the site http://christianstore.biz/catalog you will see that the sidebox appears on the top lefthand side of the sideboxes.
I am now under the opinion that I will not be able to install this plugin unless I can run an sql statement either in sql patches in the admin or directly into the database using myphpadmin, because I was able to run successfully the above SQL statement: REPLACE INTO admin_pages_to_profiles (profile_id, page_key) VALUES ('2', 'bookxProduct').
Thanks again for your help.
Re: New add-on "product type book" for ZC 1.5
Quote:
Originally Posted by
fjbern1943
First I want to thank you for your active participation in trying to solve my problem installing bookx.
That is very nice, thank you. In the end that's what one gets themselves into with open source development and if I am offering you software, be it paid or not, then it should be working too ;)
On to your problem:
I must have been blind before, because now I do see a MYSQL syntax error in my script and don't ask me why it has never triggered an error here.
On line 950 and on line 631 of the installation script in file [YOUR-ADMIN-FOLDER]/includes/init_includes/init_product_type_bookx.php it should read:
Code:
$db->Execute("REPLACE INTO {$const['TABLE_ADMIN_PAGES_TO_PROFILES']} (profile_id, page_key) VALUES ('{$profile_ids->fields['profile_id']}', 'bookxProduct')");
Note that at the end of the line it is ')"); so a closing bracket was indeed missing. Could you try to correct that and see if it works?
Regards,
p.
Re: New add-on "product type book" for ZC 1.5
Yeah,success!
I would like to download the entire plugin again with the necessary changes to the init_product_type_bookx.php and the missing file as discussed before.
Re: New add-on "product type book" for ZC 1.5
Great news!
let me put that together and I will let you know here when the file at Sourceforge is updated. I will submit here at ZC.com at the same time, but it usually takes much longer until the download shows up.