Results 1 to 9 of 9
  1. #1
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Fresh install won't let me create a product of type document_general

    PHP 7.1, MySQL on Ubuntu 17.04, ZC 1.5.5.e fresh install, no plugins.

    A quick question, I seem to be overlooking something, or doing something really wrong. Like the subject says: a fresh install throws an error at me, whenever in a newly created category, I try to make a product of the type document_general. Preview works, but after several fresh installs, it just won't create the product. I repaired it in the file YOUR_ADMIN/include/modules/document_general/collect_info.php at line 303 by inserting:
    Code:
    echo zen_draw_hidden_field('products_quantity_mixed','0') .
           zen_draw_hidden_field('products_qty_box_status', '1') .
           zen_draw_hidden_field('products_quantity_order_max', 1);
    I don't like this solution, but at the moment I can go on with other work, and wait for comments of a ZEN guru

  2. #2
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fresh install won't let me create a product of type document_general

    Quote Originally Posted by jarlee View Post
    throws an error at me
    I've tried reading between the lines, but I can't figure out what the actual error message is. Care to share?

    Ref: http://www.zen-cart.com/content.php?124-blank-page
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  3. #3
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fresh install won't let me create a product of type document_general

    The message that appears, won't say much, just after pressing the "INSERT" button on the Preview pane, I get the message "WARNING: An Error occurred, please refresh the page and try again.".
    The resulting logfile will tell a much more interesting story:

    Code:
    [22-Sep-2017 10:52:53 Europe/Berlin] Request URI: /YOURADMIN/document_general.php?cPath=1&product_type=3&action=insert_product, IP address: 192.168.2.244
    #1  trigger_error() called at [/var/www/htdocs/includes/classes/db/mysql/query_factory.php:167]
    #2  queryFactory->show_error() called at [/var/www/htdocs/includes/classes/db/mysql/query_factory.php:139]
    #3  queryFactory->set_error() called at [/var/www/htdocs/includes/classes/db/mysql/query_factory.php:266]
    #4  queryFactory->Execute() called at [/var/www/htdocs/YOURADMIN/includes/functions/database.php:53]
    #5  zen_db_perform() called at [/var/www/htdocs/YOURADMIN/includes/modules/update_product.php:69]
    #6  require(/var/www/htdocs/YOURADMIN/includes/modules/update_product.php) called at [/var/www/htdocs/YOURADMIN/document_general.php:55]
    
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP Fatal error:  1366:Incorrect integer value: '' for column 'products_quantity_mixed' at row 1 :: insert into ny_products (products_quantity, products_type, products_model, products_price, products_date_available, products_weight, products_status, products_virtual, products_tax_class_id, manufacturers_id, products_quantity_order_min, products_quantity_order_units, products_priced_by_attribute, product_is_free, product_is_call, products_quantity_mixed, product_is_always_free_shipping, products_qty_box_status, products_quantity_order_max, products_sort_order, products_discount_type, products_discount_type_from, products_price_sorter, products_image, products_date_added, master_categories_id) values ('0', '3', '', '0', null, '0', '1', '0', '0', '0', '1', '1', '0', '0', '0', '', '0', '', '', '0', '0', '0', '0', '', now(), '1') ==> (as called by) /var/www/htdocs/YOURADMIN/includes/functions/database.php on line 53 <== in /var/www/htdocs/includes/classes/db/mysql/query_factory.php on line 167
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP Stack trace:
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP   1. {main}() /var/www/htdocs/YOURADMIN/document_general.php:0
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP   2. require() /var/www/htdocs/YOURADMIN/document_general.php:55
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP   3. zen_db_perform() /var/www/htdocs/YOURADMIN/includes/modules/update_product.php:69
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP   4. queryFactory->Execute() /var/www/htdocs/YOURADMIN/includes/functions/database.php:53
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP   5. queryFactory->set_error() /var/www/htdocs/includes/classes/db/mysql/query_factory.php:266
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP   6. queryFactory->show_error() /var/www/htdocs/includes/classes/db/mysql/query_factory.php:139
    [22-Sep-2017 10:52:53 Europe/Berlin] PHP   7. trigger_error() /var/www/htdocs/includes/classes/db/mysql/query_factory.php:167
    Just tell me if this provides enough information or if you need more.

  4. #4
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Fresh install won't let me create a product of type document_general

    To me the solution looks acceptable since this product type is designed to not allow addition to the cart, some "values" were not previously posted to the page and previously a '' would be interpreted as a 0. Under stricter configurations, the 0 needs to be passed along if a specific update_product file is not generated. The suggested fix will at least pass the information along to be processed by the preview_product and end up in the update_product processing.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  5. #5
    Join Date
    Sep 2009
    Location
    Stuart, FL
    Posts
    12,399
    Plugin Contributions
    87

    Default Re: Fresh install won't let me create a product of type document_general

    That looks like a decent patch to get you going, but ultimately I believe that the base /admin/includes/modules/update_product.php needs to be updated to ensure that any integer-type fields should be forced to integer-typed values.

  6. #6
    Join Date
    Jan 2004
    Posts
    66,364
    Blog Entries
    7
    Plugin Contributions
    274

    Default Re: Fresh install won't let me create a product of type document_general

    Here are the updated files to make it work with the stricter rules being imposed by your MySQL version.
    https://github.com/zencart/zencart/pull/1516/files
    .

    Zen Cart - putting the dream of business ownership within reach of anyone!
    Donate to: DrByte directly or to the Zen Cart team as a whole

    Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
    Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.

  7. #7
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fresh install won't let me create a product of type document_general

    DrByte, I bow to the wisdom of the changes you made in the code files. Looks like you did a lot of work in just a couple of hours :)

    The diffs are not hard to read, but you have to be meticulous to implement them. Like I see it now, MySQL became stricter, so passing arguments to the database needs to be stricter as well. Simply said, the argument passed to MySQL cannot be '', but the value returned the the ConvertToFloat function will take care of inserting a '0' instead. No discussion needed here, just an explanation that the problem has been found and will be taken care of in future updates, right?

  8. #8
    Join Date
    Jul 2012
    Posts
    16,718
    Plugin Contributions
    17

    Default Re: Fresh install won't let me create a product of type document_general

    Hopefully are able to read the top of the page of this image which is taken from the link that DrByte posted above and shows the answer to that question as yes, in ZC 1.5.6:
    Name:  IMG_20170922_125723.jpg
Views: 118
Size:  28.9 KB
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

  9. #9
    Join Date
    Aug 2010
    Posts
    25
    Plugin Contributions
    0

    Default Re: Fresh install won't let me create a product of type document_general

    That one slipped by me! Thanks all for the fast answering, appreciated

 

 

Similar Threads

  1. Admin page won't load on fresh install/upgrade on Godaddy
    By cardioforce in forum Installing on a Linux/Unix Server
    Replies: 3
    Last Post: 3 Nov 2015, 09:14 AM
  2. Fresh install - won't display Admin
    By 4thwave in forum Upgrading from 1.3.x to 1.3.9
    Replies: 14
    Last Post: 3 Dec 2010, 11:15 PM
  3. Images won't show up on a fresh install
    By wolfsinger in forum Templates, Stylesheets, Page Layout
    Replies: 1
    Last Post: 1 Oct 2008, 12:34 PM
  4. Product Type Document_General
    By Veronika7747 in forum General Questions
    Replies: 1
    Last Post: 4 Dec 2007, 06:21 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
disjunctive-egg
Zen-Cart, Internet Selling Services, Klamath Falls, OR