Skip to content

Invalid structure item breaks entry augmentation #14801

Description

@morhi

Bug description

When trying to augment an entry (->toAugmentedArray()) I discovered a array_flip error (array_flip(): Can only flip string and integer values). This is error comes from the Entry::order() call. I found out that the structure contains a null item, which breaks the array_flip call. My appeal would be to make the order() call more robust and research the structure saving issue in a different issue.

How to reproduce

I do not know why the structure has a null item in the first place, but the structure simply needs to contain a null item:

[{"entry":"4ed307c6-0567-4ed2-a6be-c651832f57ee"},null]

Environment

Environment
Application Name: Statamic
Laravel Version: 11.54.0
PHP Version: 8.2.29
Composer Version: 2.9.5
Environment: local
Debug Mode: ENABLED
URL: sonntag.ddev.site
Maintenance Mode: OFF
Timezone: Europe/Zurich
Locale: de

Cache
Config: NOT CACHED
Events: NOT CACHED
Routes: NOT CACHED
Views: CACHED

Drivers
Broadcasting: null
Cache: file
Database: mysql
Logs: stack / single
Mail: smtp
Queue: sync
Session: file

Livewire
Livewire: v4.3.1

Statamic
Addons: 18
Sites: 1
Stache Watcher: Enabled (auto)
Static Caching: Disabled
Version: 5.73.24 PRO

Installation

Other (please explain)

Additional details

No response

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