Skip to content
This repository has been archived by the owner on Sep 8, 2019. It is now read-only.

Image transforms not working #2

Open
Djive opened this issue Nov 1, 2018 · 4 comments
Open

Image transforms not working #2

Djive opened this issue Nov 1, 2018 · 4 comments

Comments

@Djive
Copy link

Djive commented Nov 1, 2018

We have a multi-site setup with many sites.
Each site will be run by its own Content Manager.
All sites share the same assets so that we don't have many duplicated assets when content is published on more then one site.
But we wanted each Content Manager to only see his assets in the control panel.
All worked fine untill we started to implement transforms via templates.

Then we noticed that everything which is uploaded by Super Admin cannot be transformed, instead we get this error:
Call to a member function getVolume() on null

If we visit the front end as Super Admin, images get transformed normally.

When we removed the field "Uploaded By" from the volume we were testing on, images were transformed normally for everyone.

  • If Super Admin uploads the image, when Content Manager or Guest visits the site, images will not transform.
  • If Content Manager uploads the image, images will normally transform for everyone who visits the site.

PHP version | 7.2.10
Database driver & version | MySQL 5.6.38
Image driver & version | Imagick 3.4.3RC4 (ImageMagick 6.9.4-10)
Craft edition & version | Craft Pro 3.0.29

Thanks!

@noxify
Copy link
Owner

noxify commented Nov 18, 2018

Hi @Djive,

thanks for reporting the issue.

To be honest, I didn't tested it in the past with a multi-site setup.

I can take a look into it, but currently I have no running Craft environment.

Greets,
Marcus

@Djive
Copy link
Author

Djive commented Nov 19, 2018

Also, just to report, image transforms didn't work for us after import aswell.
As soon as we deinstalled Asset Ownership addon, transforms worked.
So for now, will go on without the addon.

Thanks!

@xhuang9
Copy link

xhuang9 commented Feb 28, 2019

Just modify one line of code will fix this issue:
asset-ownership/src/AssetOwnership.php line 77 change to
if( Craft::$app->request->isCpRequest && !Craft::$app->user->getIsAdmin() && !Craft::$app->user->checkPermission('viewPeerAssets') )

@noxify
Copy link
Owner

noxify commented Mar 1, 2019

Hi,

thanks @xhuang9 for the input.
I changed it in the master branch.
https://github.com/noxify/asset-ownership/blob/master/src/AssetOwnership.php#L77

@Djive if you want, give it a try and let me know if it's working or not.

I have currently no time to test it in detail - sorry!

Regards,
Marcus

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

No branches or pull requests

3 participants