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

flushImageArray() problem #254

Closed
dven84 opened this issue Nov 29, 2018 · 6 comments
Closed

flushImageArray() problem #254

dven84 opened this issue Nov 29, 2018 · 6 comments
Assignees

Comments

@dven84
Copy link

dven84 commented Nov 29, 2018

What steps will reproduce the problem?

luya-module-admin v.1.2.3

  1. create new image filter
  2. open page:
foreach ($articles as $article) {
  echo Yii::$app->storage->getImage($article->image_id)->applyFilter('new-filter')->source;
}

What do you get instead?

ERROR Call to a member function applyFilter() on boolean

return isset($this->imagesArray[$imageId]) ? $this->imagesArray[$imageId] : false;

And in next iteration $this->imagesArray[$imageId] is not exist

@nadar nadar self-assigned this Nov 30, 2018
@nadar
Copy link
Member

nadar commented Nov 30, 2018

if you disable the cache - it works i assume?

@dven84
Copy link
Author

dven84 commented Nov 30, 2018

DummyCache or FileCache - no difference

@nadar
Copy link
Member

nadar commented Feb 26, 2019

I am unable to reproduce problem, you exceptions says that Yii::$app->storage->getImage($article->image_id) seems to be false, so mabye there is just no image found. Because the problem is not about the filter - it can not even try to apply the filter. Do you have some more informations? What if you add another check if image exists? Like $image = ...; if ($image) { // apply }

@dven84
Copy link
Author

dven84 commented Feb 27, 2019

luya

@nadar
Copy link
Member

nadar commented Feb 27, 2019

@dven84 thanks! That looks interesting :-)

@nadar nadar added bug and removed bug:research labels Jul 3, 2019
@nadar
Copy link
Member

nadar commented Jul 3, 2019

I will fix it asap! Thanks for the report @dven84

@nadar nadar closed this as completed Sep 13, 2019
slowfox089 pushed a commit to slowfox089/luya-module-admin that referenced this issue Dec 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants