Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Statamic Navigation - unable to link collections or create Link to Entry #7117

Closed
Smilodown opened this issue Nov 25, 2022 · 3 comments
Closed

Comments

@Smilodown
Copy link

Bug description

Hi everyone,
On a Statamic fresh install, i just created Posts collection.
I'd like to link Posts ans Pages to navigation items, but when I select the Collections selector, it shows :
Capture d’écran 2022-11-25 à 14 02 48

On the console :
Capture d’écran 2022-11-25 à 14 02 56

I didn't have this error before....

I'm stuck right now. My Pro licences are useless for now.

How to reproduce

Install Statamic (CLI)
Create Posts Collection (no blueprint attached)
Create Navigation
Configure Navigation > Try to select Pages/Posts on the Collection Selector

Logs

No response

Environment

MAMP Pro :
PHP: 8.1
Statamic: 3.3.58
Coffee : Nespresso Pixie

Installation

Fresh statamic/statamic site via CLI

Antlers Parser

No response

Additional details

No response

@stephanbouman
Copy link
Contributor

stephanbouman commented Nov 27, 2022

I have the same issue. Fresh statamic installation and tried running with Artisan Serve. The error on the php-side:

{
  "message": "Trying to access array offset on value of type null",
  "exception": "ErrorException",
  "file": "/Users/username/Projects/demoproject/vendor/statamic/cms/src/Http/Controllers/CP/Fieldtypes/RelationshipFieldtypeController.php",
  "line": 47
}

The same issue appears when you try to select an entry from an 'entries' field.

Edit:
See: #6823
When you update php 8.1.2+ it should work again. Tested it with php 8.1.11.

@Smilodown
Copy link
Author

@stephanbouman
Just gave a try and ! Ta-dam ! It works again.
As you said, it must be a PHP 8.0 & PHP 8.1 specific issue.
Thanks a lot ! You saved my day.

@jasonvarga
Copy link
Member

Closing this as it's so specific to that PHP version. Upgrading PHP from 8.1.0 to at least 8.1.2 will fix it. Nice detective work.

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

No branches or pull requests

4 participants