• Our web host recently upgraded to PHP 8.0. Now, we get an error when we try to upload a spreadsheet. Here’s the message from the error log:

    PHP Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /public/wp-content/plugins/ymm-search/Model/Db/CsvImportHandler.php:57

    Stack trace:

    #0 /public/wp-content/plugins/ymm-search/Model/Db/CsvImportHandler.php(57): implode(Array, ‘”,”‘)

    #1 /public/wp-content/plugins/ymm-search/Controller/Adminhtml/Ymm/Selector.php(38): Pektsekye_Ymm_Model_Db_CsvImportHandler->importFromCsvFile(Array, ‘add_new’)

    #2 /public/wp-includes/class-wp-hook.php(308): Pektsekye_Ymm_Controller_Adminhtml_Ymm_Selector->execute(”)

    #3 /public/wp-includes/class-wp-hook.php(332): WP_Hook->apply_filters(NULL, Array)

    #4 /public/wp-includes/plugin.php(517): WP_Hook->do_action(Array)

    #5 /public/wp-settings.php(617): do_action(‘init’)

    Is there something I can do to correct this?

    Thanks!

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    Try to replace:

    implode($fieldNames,'","')

    with:

    implode('","', $fieldNames)

    on line 57 in the file:

    wp-content/plugins/ymm-search/Model/Db/CsvImportHandler.php

    Stanislav

    Thread Starter shanse2

    (@shanse2)

    Thank you for the fast response! When I make that change and try to upload a CSV, I get this error on the upload page:

    “Ymm CSV file has not been imported. The first row in the .csv file must contain correct column names. And the columns should have special order: “product_sku”,”brand”,”series”,”model””

    Plugin Author Pektsekye

    (@pektsekye)

    Hello,

    So the csv file should contains the columns:

    “product_sku”,”brand”,”series”,”model””

    Or send the .csv file to me [email protected] I will check it.

    Stanislav

    Thread Starter shanse2

    (@shanse2)

    I took a look at the CSV and the column names looked fine, but it still wouldn’t upload. So, I exported the current CSV file, pasted the new data in that file, and re-uploaded it. That worked! It’s all running as it should again. Thank you so much for your help!

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘PHP 8 Errors’ is closed to new replies.