From 27550899d01023092df5ff1cc9a51d34d0d39281 Mon Sep 17 00:00:00 2001 From: Mattia Verga Date: Sun, 16 Sep 2018 10:11:57 +0200 Subject: [PATCH] Allow plugin to work in frontend. Version 1.3.3 Fixes #3 --- README.md | 3 +++ automaticintroimage.php | 4 ++-- automaticintroimage.xml | 2 +- manifest.xml | 6 +++--- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 43120af..89e1974 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,9 @@ Automatic Intro Image needs IMagick php module to be installed and enabled on yo See https://github.com/mattiaverga/JAutomaticIntroImage/wiki for more help. ## Changelog +### v1.3.3 +* Fix: allow plugin to work in frontend + ### v1.3.1 * Add support for Joomla extension updater diff --git a/automaticintroimage.php b/automaticintroimage.php index 7ae5dc1..87f0329 100755 --- a/automaticintroimage.php +++ b/automaticintroimage.php @@ -22,7 +22,7 @@ class plgContentAutomaticIntroImage extends JPlugin * * @param string $context The context of the content being passed to the plugin. - * @param mixed $article A reference to the JTableContent object that is + * @param mixed $article The JTableContent object that is being saved which holds the article data. * @param boolean $isNew A boolean which is set to true if the content is about to be created. @@ -32,7 +32,7 @@ class plgContentAutomaticIntroImage extends JPlugin public function onContentBeforeSave($context, $article, $isNew) { // Check if we're saving an article - $allowed_contexts = array('com_content.article'); + $allowed_contexts = array('com_content.article','com_content.form'); if (!in_array($context, $allowed_contexts)) { diff --git a/automaticintroimage.xml b/automaticintroimage.xml index 5e1c411..1d1e8ba 100644 --- a/automaticintroimage.xml +++ b/automaticintroimage.xml @@ -6,7 +6,7 @@ Copyright (C) 2017 Mattia Verga. All rights reserved. GNU General Public License version 3 or later. mattia.verga@tiscali.it - 1.3.2 + 1.3.3 PLG_CONTENT_AUTOMATICINTROIMAGE_XML_DESCRIPTION automaticintroimage.php diff --git a/manifest.xml b/manifest.xml index 9c50202..ee596c3 100644 --- a/manifest.xml +++ b/manifest.xml @@ -6,11 +6,11 @@ automaticintroimage plugin content - 1.3.2 + 1.3.3 site - https://github.com/mattiaverga/JAutomaticIntroImage/releases/tag/1.3.2 + https://github.com/mattiaverga/JAutomaticIntroImage/releases/tag/1.3.3 - https://github.com/mattiaverga/JAutomaticIntroImage/archive/1.3.2.zip + https://github.com/mattiaverga/JAutomaticIntroImage/archive/1.3.3.zip