craftsmancoding / assetmanager

Asset Manager for MODX Revolution
36 stars 15 forks source link

[Urgent] AssetManager doesn't show photos after update #86

Closed alikmster closed 6 years ago

alikmster commented 6 years ago

Today I've updated the component to 1.2.0 (wow, it's alive), but no photos are visible on the website and I don't get any error.

Mark-H commented 6 years ago

Any errors in the MODX error log?

alikmster commented 6 years ago

I would be happy if so, but no.

Mark-H commented 6 years ago

Hmm, I'm not seeing anything in the code changes since 1.1.1 that would explain such a break...

Mark-H commented 6 years ago

In the getPageAssets snippet, change line 72-76 with the following:


$innerTpl = $modx->getOption('innerTpl', $scriptProperties, '<li><img src="[[+Asset.url]]" width="[[+Asset.width]]" height="[[+Asset.height]]" alt="[[+Asset.alt]]" /></li>', true);
$outerTpl = $modx->getOption('outerTpl', $scriptProperties, '<ul>[[+content]]</ul>', true);
$firstTpl = $modx->getOption('firstTpl', $scriptProperties, $innerTpl, true);
$lastTpl = $modx->getOption('lastTpl', $scriptProperties, $innerTpl, true);
$onOne = $modx->getOption('onOne', $scriptProperties, 'innerTpl', true);

That seems to help get stuff to show up.

I suspect that something I did in preparing the build caused it to install snippet properties, which it may not have done before, and the snippet was not built with those in mind. It's checking properties with the assumption that if they are set, that they have the value it needs to use, rather than checking if it actually has a value.

The &is_image and &group property may also be needed on your snippet call.

alikmster commented 6 years ago

Ok, I'll check and reply. Thank you!

Mark-H commented 6 years ago

Please see the full changes I've made in #87 and let me know if that fixes it. If so I can push out a 1.2.1 build today.

alikmster commented 6 years ago

Yes, now everything works!

Mark-H commented 6 years ago

Excellent, I'll push out a 1.2.1 release.

fireproofsocks commented 6 years ago

Marking closed.