creativeorange / craft-article

Edit richt text content in Craft CMS using Article by Imperavi.
Other
7 stars 3 forks source link

ArticleEditor volumes not getting populated except for admin users #23

Closed hatyi closed 9 months ago

hatyi commented 1 year ago

Hello I'd like to ask for some help / report an issue we face.

We migrated to Craft 4 a few weeks ago in a project and some editors started reporting issues which is according to our current understanding on the topic is related this plugin.

When they are trying to add images through the editor they can not see the proper volumes they should have access to in the popup modal. The only option I had to fix this, was to temporarily give them admin permission on the site, which I hope I can revoke from them as soon as possible.

This is the payload of the request from an admin user article-editor-admin

And this one is from a non-admin user article-editor-non-admin

I'm not entirely sure what kind of permission is necessary for this to work, but I made sure all of these users have full acccess to every single volume on the site.

I don't have much experience with developing complex frontend functionalities for the Craft admin area, but I just quickly looked into the JS part of the plugin to see how these volumes are getting populated. This is what I see when I console.log out the content of the craftSettings variable in the init function of the ArticleEditor.

Admin user: craftsettings-admin

Non admin user: craftsettings-non-admin

Our current dependencies (copied from composer.json)

  "require": {
    "born05/craft-assetusage": "3.0.0",
    "craftcms/cms": "4.3.7.1",
    "craftcms/commerce": "4.2.5.1",
    "craftcms/commerce-stripe": "3.1.0",
    "craftcms/feed-me": "5.0.5",
    "craftcms/redactor": "3.0.3",
    "creativeorange/craft-article": "2.0.1",
    "diginov/craft-sentry-logger": "4.1.1",
    "doublesecretagency/craft-spoon": "4.0.3",
    "enshrined/svg-sanitize": "~0.15.2",
    "ether/simplemap": "4.0.3",
    "ether/tags": "2.0.0",
    "html2text/html2text": "^4.2",
    "lewisjenkins/craft-dynamic-fields": "4.0.3",
    "loilo/fuse": "^6.4",
    "luwes/craft3-codemirror": "2.0.0",
    "mmikkel/child-me": "1.3.1",
    "mmikkel/cp-field-inspect": "1.4.4",
    "mmikkel/incognito-field": "1.3.0",
    "mmikkel/retcon": "2.6.0",
    "netlab/commerce-two": "2.0.7",
    "nystudio107/craft-autocomplete": "^1.0",
    "nystudio107/craft-instantanalytics": "4.0.2",
    "nystudio107/craft-retour": "4.1.9",
    "nystudio107/craft-seomatic": "4.0.19",
    "phpseclib/phpseclib": "^2.0",
    "presseddigital/linkit": "4.0.4.1",
    "putyourlightson/craft-blitz": "4.2.3",
    "spacecatninja/imager-x": "4.1.10",
    "spacecatninja/imager-x-do-spaces-driver": "^3.0",
    "studioespresso/craft-scout": "3.0.0",
    "utakka/redactor-anchors": "1.4.0",
    "verbb/image-resizer": "3.0.4",
    "verbb/navigation": "2.0.16",
    "verbb/super-table": "3.0.7",
    "verbb/wishlist": "2.0.4",
    "vlucas/phpdotenv": "^3.4.0",
    "webonyx/graphql-php": "~14.11.5",
    "yiisoft/yii2": "^2.0.46.0",
    "yiisoft/yii2-redis": "^2.0.6"
  }

I'm not sure if this is an issue with Craft or this plugin or even with our config, but it would be highly appriciated if you could provide some help. If you need any further detail on this or about our project please just let me know and I'll get back to you ASAP.

hatyi commented 1 year ago

I think the potential error is somewhere around the src/Article.php _getVolumeKeys() method, but I'm still unsure if it's Craft related or this is some kind of validation error in the plugin.