Laravel-Backpack / PermissionManager

Admin interface for managing users, roles, permissions, using Backpack CRUD
http://backpackforlaravel.com
Other
516 stars 166 forks source link

Unrendered @loadOnce directive on create/edit user view #296

Closed joeycoonce closed 2 years ago

joeycoonce commented 2 years ago

Bug report

What I did:

Installed permissionmanager on fresh install of Laravel and Backpack

What I expected to happen:

Blade directives rendered, not displayed

What happened:

When creating or editing users, the text @loadOnce('bpFieldInitChecklistDependencyElement') @endLoadOnce is displayed on the lower left corner of page.

What I've already tried to fix it:

Recreated issue with fresh install Determined the code is lines 199-286 in /vendor/backpack/crud/src/resources/views/crud/fields/checklist_dependency.blade.php Directly updated digitallyhappy/assets in permissionmanager via composer, no effect.

Backpack, Laravel, PHP, DB version:

Laravel v9.3.1 PHP v8.0.14 Backpack CRUD v5.0.9 laravel-permission v5.5.1 permissionmanager v6.0.14

Screenshot for reference:

Screenshot 2022-03-05 6 32 29 AM

welcome[bot] commented 2 years ago

Hello there! Thanks for opening your first issue on this repo!

Just a heads-up: Here at Backpack we use Github Issues only for tracking bugs. Talk about new features is also acceptable. This helps a lot in keeping our focus on improving Backpack. If you issue is not a bug/feature, please help us out by closing the issue yourself and posting in the appropriate medium (see below). If you're not sure where it fits, it's ok, a community member will probably reply to help you with that.

Backpack communication mediums:

Please keep in mind Backpack offers no official / paid support. Whatever help you receive here, on Gitter, Slack or Stackoverflow is thanks to our awesome awesome community members, who give up some of their time to help their peers. If you want to join our community, just start pitching in. We take pride in being a welcoming bunch.

Thank you!

-- Justin Case The Backpack Robot

pxpm commented 2 years ago

Hey @joeycoonce thanks for the report.

Could you confirm you did php artisan view:clear ?

We already fixed something similar to that, so I guess you just need to update your dependencies https://github.com/DigitallyHappy/assets/pull/11#pullrequestreview-878670128

Let me know if I am wrong.

Thanks

joeycoonce commented 2 years ago

@pxpm I can confirm that I have run php artisan view:clear and that did not resolve the issue. Since this issue is present on a fresh install as of this morning, I could use a little guidance as to which dependencies would need to be updated. I tried requiring digitallyhappy/assets,currently 2.0.3, in my project directly, as well as updating backpack/crud and backpack/permissionmanager, (and rerunning php artisan view:clear), just to see if it would resolve the issue, whitch it did not.

pxpm commented 2 years ago

Indeed assets 2.0.3 is the one that fixed a similar issue. https://github.com/DigitallyHappy/assets/releases/tag/2.0.3

It's only happening with @loadOnce directive? Other directives work fine? You can for example use @hasRole from permission manager to test if it works?

joeycoonce commented 2 years ago

As I have only encountered the error within the implementation of the permissionmanager module, I haven't previously used either of these directives directly. As requested, I tested using these blade directives on a frontend view and encountered a similar failure to render when using @loadOnce. @hasRole also failed, but @hasrole rendered and worked as expected (@loadonce still failed to render).

joeycoonce commented 2 years ago

The workaround identified in https://github.com/Laravel-Backpack/CRUD/issues/4251#issuecomment-1059955993 of locking spatie/laravel-permission in 5.5.0 version resolves my issue. Will hold tight for a PR fix. Thanks @pxpm