diff --git a/CHANGELOG.md b/CHANGELOG.md index b42223f..b200529 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,10 @@ +# v1.0.8 +## 18/10/2022 + +1. [](#bugfix) + * Fix revision selection algorithm + + # v1.0.7 ## 15/10/2022 diff --git a/blueprints.yaml b/blueprints.yaml index 461b482..fed0d23 100644 --- a/blueprints.yaml +++ b/blueprints.yaml @@ -1,5 +1,5 @@ name: Astrobin -version: 1.0.7 +version: 1.0.8 description: "This plugin provides astrobin shortcodes for images and galleries" icon: picture-o author: diff --git a/classes/Image.php b/classes/Image.php index e746b9f..a6d8835 100644 --- a/classes/Image.php +++ b/classes/Image.php @@ -38,6 +38,7 @@ public function datetaken() { public function url($format, $revision_type="final", $animated=false) { $revision_obj = NULL; + // dump($revision_type); if($revision_type == "final") { foreach($this->revisions as $revision) { if($revision->is_final) { @@ -52,7 +53,7 @@ public function url($format, $revision_type="final", $animated=false) { foreach($this->revisions as $revision) { $this->grav['debugger']->addMessage(' - Revision: '); $this->grav['debugger']->addMessage($revision); - if(property_exists($revision, 'label')) { + if(property_exists($revision, 'label') && $revision->label == $revision_type) { $this->grav['debugger']->addMessage('Revision label: ' . $revision->label); $revision_obj = $revision; break; @@ -63,6 +64,7 @@ public function url($format, $revision_type="final", $animated=false) { $revision_obj = $this->revisions[0]; } } + // dump($revision_obj); $url = $revision_obj->{'url_' . $format}; if($animated) { $url .= '?animated';