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

NOT WORKING WITH FLEXIBLE CONTENT #209

Open
ikramooe opened this issue Aug 8, 2022 · 2 comments
Open

NOT WORKING WITH FLEXIBLE CONTENT #209

ikramooe opened this issue Aug 8, 2022 · 2 comments
Labels
more info required More information is required

Comments

@ikramooe
Copy link

ikramooe commented Aug 8, 2022

when i use this package inside nova flexible content i get the error " attempt to read property on array" in the view page
how can i solve this
it's really urgent

@NoahNxT
Copy link
Contributor

NoahNxT commented Dec 4, 2022

Please provide more details, we cannot reproduce issues with only a short message like this.

@NoahNxT NoahNxT added the more info required More information is required label Dec 4, 2022
@youngestdj
Copy link

youngestdj commented Jun 27, 2024

@NoahNxT when using Nova Flexible Content https://github.com/whitecube/nova-flexible-content, you get a

Attempt to read property "song_lyric" on array {"userId":1,"exception":"[object] (ErrorException(code: 0): Attempt to read property \"song_lyric\" on array at /var/www/vendor/epartment/nova-dependency-container/src/NovaDependencyContainer.php:177)

error
This is on v1.3

Nova flexible content saves your entries in a json column like this

  {
    "key": "3ae72c1ef9eb6f62",
    "layout": "Quote",
    "attributes": {
      "button_url": "https://gtihub.com",
      "song_lyric": true
    }
  },

  {
    "key": "cf7704cc44d9000c",
    "layout": "copy-block",
    "attributes": { "copy": "<p>Ministers</p>\n" }
  }
]

Throws an error for song_lyric as it's being used as a dependency

Boolean::make('Song Lyric', 'song_lyric')->hideFromIndex()->hideFromDetail(),
            NovaDependencyContainer::make([
              // ... stuff
                Boolean::make('Play Button', 'play_button'),
            ])
                ->dependsOn('song_lyric', true)
                ->hideFromIndex()
                ->hideFromDetail()

Everything works on the edit page, but it errors on the view page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
more info required More information is required
Projects
None yet
Development

No branches or pull requests

3 participants