Skip to content

Images cause error when repeatedly running populate task. #45

@davejtoews

Description

@davejtoews

Version 2.1.0

Relevant portion of my yml

SilverStripe\Assets\Image:
  imageOne:
    Created: "1970-01-02 03:04:05"
    Filename: assets/TestContent/imageBlockOne.jpg
    PopulateFileFrom: app/fixtures/assets/546-900x600.jpg
    PopulateMergeMatch:
      - Created

App\Elements\ImageElement:
  imageBlockOne:
    Title: Image Element
    ShowTitle: true
    Created: "1970-01-02 03:04:05"
    ImageID: =>SilverStripe\Assets\Image.imageOne
    ParentID: =>DNADesign\Elemental\Models\ElementalArea.imageArea
    PopulateMergeMatch:
      - Created

This runs fine the first time, but on the second pass creating the image results in the following:

[Notice] Trying to get property 'ID' of non-object
Line 72 in /var/www/html/vendor/dnadesign/silverstripe-populate/code/PopulateFactory.php

And then attempting to reference the image results in:

[Emergency] Uncaught InvalidArgumentException: No fixture definitions found for "=>SilverStripe\Assets\Image.imageOne"
Line 332 in /var/www/html/vendor/silverstripe/framework/src/Dev/FixtureBlueprint.php

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions