Skip to content

$importerModel->getLogTrace() return empty string #131

Open

Description

@ildelux

Hi, I've updated to the new version 2.0.1
Unfortunately the public function $importerModel->getLogTrace() return empty string.
It was very convenient to have the import log.
Why was it eliminated?
Would it be possible to get it back?
Or is there an other way to do get the same thing?
Thank you.

Activity

  1. sprankhub commented on Jul 21, 2024

    @sprankhub
    Member

    @avstudnitz, I think I've noticed this myself in the past, and I think it happened during your bigger refactoring for v2. Do you have any idea / would you have the chance to look into this? 🙏

  2. avstudnitz commented on Jul 23, 2024

    @avstudnitz
    Member

    I'm using this process which works well:

    try {
        $this->importer->processImport($importData);
    } catch (\Exception $e) {
        $this->handleFatalError($e);
        throw $e;
    } finally {
        $this->handleRowErrors($this->importer->getErrorAggregator()->getAllErrors());
    }
    

    The errors contain row number and error message so I can mark the entries for re-import or notify someone.

    I don't have time to look into why the original function is not available any more at the moment, but I'll try to do that during the next hackathon.

  3. lbajsarowicz commented on Nov 20, 2026

    @lbajsarowicz
    Contributor

    @ildelux thanks for the report, I reproduced this on Magento Open Source 2.4.9 / PHP 8.5 with FireGento_FastSimpleImport2 (develop, commit 4a2d71e):

    1. Install the module and run a product import through FireGento\FastSimpleImport\Model\Importer (setEntityCode('catalog_product'), then processImport() with one valid row).
    2. Call $importer->getLogTrace() after processImport().
    3. Repeat with an additional invalid row (unknown attribute set, non-numeric price) so that processImport() throws a ValidationException, then call getLogTrace() in the catch block.

    Observed in both cases:

    LOGTRACE[0]: ""
    

    The import model does collect a trace (Magento\ImportExport\Model\AbstractModel::getFormatedLogTrace() returns "Begin data validation", the validation summary, "The import was successful", and so on), but Importer::$logTrace (line 26) is never assigned: it is initialised to '' and only read by getLogTrace() (lines 223-226). The import model is also replaced between validation and import, so the trace has to be copied out after each phase.

    I'll open a pull request with a fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions