-
-
Notifications
You must be signed in to change notification settings - Fork 242
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
Empty Flexible content #475
Comments
Agree, having same issues. Laravel Nova 4.26 and latest version of this module. This breaks the entire module. |
This has been fixed with #474. A patch release has to be tagged now. |
@mabdullahsari that did not fix it. I upgraded from v1.0.8: |
@Jaspur It doesn't have a release yet (it would be 1.0.12). For now, you should be able to use dev-master as the composer version to get the changes. |
Thanks guys! |
Released in v1.0.12. Thank you for your help everyone! |
Currently, when viewing pages, the flexible content is empty.
Details
It seems to be caused by the recent changes for compatiblity with Nova 4.26, but I never had any issues in the first place with it, and now that a call to
is_a()
is replaced from\stdClass
toFluent
, the detection for\stdClass
instances is broken.I don't quite know how or why I don't experience issues in Nova 4.26 with version <1.0.9, but I don't. My layouts still are instances of
\stdClass
, so removing the check fromgetMappedLayout
inHasFlexible
seems to break my installation (getMappedLayout
returnsnull
). Reverting back to version 1.0.8 fixes the issue and is fully compatible with my usecase in Nova 4.26.For posterity and sake of completeness:
get_class
andclass_parents
arestdClass
and[]
respectively.protected $casts = ['content' => FlexibleCast::class]
to cast the content.Whitecube\NovaFlexibleContent\Layouts\Layout
class, and only having the required fields.->addLayout([Layout]::class)
.outl1ne/nova-settings
.Proposed fix
The recent commits removed the check for
is_a($item, \stdClass)
(HasFlexible.php:125
in 1.0.8). This should be added back in the same elseif asFluent::class
, probably (ex.elseif (is_a($item, Fluent::class) || is_a($item, \stdClass::class))
). I am not sure (and not feasibly able to test) whether this breaks things for people that are experiencing issues with >=1.0.9 and 4.26, hence I am not able to comfortably Pull Request.The text was updated successfully, but these errors were encountered: