eloquent-driver icon indicating copy to clipboard operation
eloquent-driver copied to clipboard

Uri field not saved on first save when Orderable is true and max depth is 1

Open JelleGroenendal opened this issue 2 years ago • 9 comments

When i have a collection that has Orderable true and has a max depth of 1 the entry URI field is only filled on the second save.

How to reproduce

  • Create a collection
  • Configure the collection
  • Allow Orderable and set max depth on 1
  • Use /{mount}/{slug} for uri creation
  • Set a mount
  • Create an entry in the collection
  • Entry is created but URI is empty
  • Open the entry and save again and URI is filled

JelleGroenendal avatar Dec 04 '23 14:12 JelleGroenendal

Can you share the full output from php please support:details please?

ryanmitchell avatar Dec 04 '23 15:12 ryanmitchell

Environment
Application Name: Statamic
Laravel Version: 10.34.2
PHP Version: 8.2.9
Composer Version: 2.6.4
Environment: production
Debug Mode: OFF
URL: site.ddev.site
Maintenance Mode: OFF

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

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

Localization
Installed: en, nl
LaravelLang\Lang\Plugin: 12.24.2
Protected Locales: en, nl
Publisher Version: 14.7.1

Statamic
Addons: 2
Antlers: runtime
Stache Watcher: Enabled
Static Caching: half
Version: 4.38.0 PRO

Statamic Addons
mitydigital/sitemapamic: 2.3.8
statamic/eloquent-driver: 2.10.0

Statamic Eloquent Driver
Asset Containers: file
Assets: file
Blueprints: file
Collection Trees: file
Collections: file
Entries: eloquent
Forms: eloquent
Global Sets: eloquent
Global Variables: file
Navigation Trees: file
Navigations: eloquent
Revisions: eloquent
Taxonomies: eloquent
Terms: eloquent

JelleGroenendal avatar Dec 05 '23 09:12 JelleGroenendal

Thanks. I can confirm it does seem to require two saves for the entry URI to be updated in this configuration. I think it will require some changes in core to make this work. I'll update you here with progress.

ryanmitchell avatar Dec 05 '23 11:12 ryanmitchell

Any update on the progress?

JelleGroenendal avatar Jan 31 '24 09:01 JelleGroenendal

Not as yet, no.

ryanmitchell avatar Jan 31 '24 09:01 ryanmitchell

We are experiencing the exact same issue.

insight-media avatar May 21 '24 10:05 insight-media

We are also experiencing this bug, when importing entries into the DB from flat files it only updates the uri field when manually saving the entry after the import.

kevinmeijer97 avatar Jun 24 '24 09:06 kevinmeijer97

I had the same issue and ended up here. I have to tell my clients to save their pages twice to have the URI field update. It's not great. I hope the PR will be merged quickly.

clementmas avatar Jul 03 '24 08:07 clementmas

@clementmas we are working on a solution.

ryanmitchell avatar Jul 03 '24 08:07 ryanmitchell