Results 1 to 1 of 1
  1. #1
    Join Date
    Jul 2012
    Posts
    16,816
    Plugin Contributions
    17

    Default Product image missing extension in filename causes error

    Okay, so not exactly an ideal situation, but it happens(ed)...

    In testing an import file to help someone identify the issue with uploading it for use in EasyPopulate 4, during the delete process of clearing the test product from the database had the following error reported in the logs directory:

    Code:
    PHP Warning:  preg_replace(): Unknown modifier 't' in  /public_html/admin/includes/functions/general.php  on line 1453
    path has been modified slightly as leading up to this is not an issue.

    PHP version is 5.6.10.

    In review of the data that had been imported for each product (data only) no images were imported/uploaded, one of the products had an image path of
    silver/turquoise-necklaces-earring-jewelry
    Note, that there is no extension applied. I do not know that such a situation would/could be considered typical if even possible to work throughout the store, but was not addressed in the code for such a scenario. I do not yet have a recommended solution, perhaps will come to one, but thought I would at least post this here in case it ever comes to be a "normal" condition.

    The lines in the area of the php file with the last line being 1453.

    Code:
        if ($duplicate_image->fields['total'] < 2 and $product_image->fields['products_image'] != '' && PRODUCTS_IMAGE_NO_IMAGE != substr($product_image->fields['products_image'], strrpos($product_image->fields['products_image'], '/')+1)) {
          $products_image = $product_image->fields['products_image'];
          $products_image_extension = substr($products_image, strrpos($products_image, '.'));
          $products_image_base = preg_replace('/' . $products_image_extension . '/', '', $products_image);
    There were no files to actually delete and the product did get deleted, but the absence of an extension for the image filename generated the error, thought it might help someone in the future and a review of the bug logs from the time of 1.5.4 being issued on did not reveal this error...
    Last edited by mc12345678; 28 Sep 2015 at 06:15 AM.
    ZC Installation/Maintenance Support <- Site
    Contribution for contributions welcome...

 

 

Similar Threads

  1. v154 Filename missing in Attributes.
    By entangled in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 9 Dec 2015, 03:09 PM
  2. get product image filename for header
    By fakeDecoy in forum General Questions
    Replies: 5
    Last Post: 22 Feb 2012, 08:50 AM
  3. Missing filename....??????? Please Help...
    By Kataryna in forum Setting Up Categories, Products, Attributes
    Replies: 6
    Last Post: 12 Oct 2011, 09:40 PM
  4. My customers cannot upload files having uppercase letters in filename extension
    By Bostitch in forum Setting Up Categories, Products, Attributes
    Replies: 4
    Last Post: 17 Jun 2008, 03:05 AM
  5. [Done v1.3.8] Image filename not saved in product table
    By georgealter in forum Bug Reports
    Replies: 1
    Last Post: 4 Mar 2007, 02:15 AM

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