Skip to content

Commit

Permalink
4.3.20
Browse files Browse the repository at this point in the history
Joomla 5 compatibility : fix getUser deprecation
  • Loading branch information
conseilgouz committed May 13, 2024
1 parent 46e9900 commit 2070814
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 8 deletions.
6 changes: 3 additions & 3 deletions mod_simple_isotope.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Simple isotope module - Joomla Module
* Version : 4.3.19
* Version : 4.3.20
* Package : Joomla 4.x/5.x
* copyright : Copyright (C) 2024 ConseilGouz. All rights reserved.
* license : https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
Expand Down Expand Up @@ -43,7 +43,7 @@
$iso_nbcol = $params->get('iso_nbcol', 2);
$tags_list = $params->get('tags', array());
// check authorised tags
$authorised = Access::getAuthorisedViewLevels(Factory::getApplication()->getIdentity());
$authorised = Access::getAuthorisedViewLevels(Factory::getApplication()->getIdentity()->get('id'));
foreach ($tags_list as $key => $atag) {
if (!IsotopeHelper::getTagAccess($atag, $authorised)) {
unset($tags_list[$key]); // not authorized : remove it
Expand Down Expand Up @@ -142,7 +142,7 @@
}
// pagination : check tags_list to add missing tags in the list
if (sizeof($tags_list) && ($params->get("pagination", "false") != 'false')) {
$authorised = Access::getAuthorisedViewLevels(Factory::getApplication()->getIdentity());
$authorised = Access::getAuthorisedViewLevels(Factory::getApplication()->getIdentity()->get('id'));
$missings = IsotopeHelper::getMissingTags($tags_list, $authorised);
foreach ($missings as $tag) {
if (!in_array($tag->tag, $tags)) {
Expand Down
2 changes: 1 addition & 1 deletion mod_simple_isotope.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
<license>GNU General Public License version 3 or later; see LICENSE.txt</license>
<authorEmail>pascal.leconte@conseilgouz.com</authorEmail>
<authorUrl>www.conseilgouz.com</authorUrl>
<version>4.3.19</version>
<version>4.3.20</version>
<description>SIMPLEISOTOPEDESC</description>
<namespace path="src">ConseilGouz\Module\SimpleIsotope</namespace>
<scriptfile>script.php</scriptfile>
Expand Down
11 changes: 11 additions & 0 deletions mod_simple_isotope_changelog.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,15 @@
<changelogs>
<changelog>
<element>mod_simple_isotope</element>
<type>Module</type>
<version>4.3.20</version>
<note>
<item>Update : 13/05/2024</item>
</note>
<fix>
<item>Joomla 5 compatibility : fix getUser deprecation</item>
</fix>
</changelog>
<changelog>
<element>mod_simple_isotope</element>
<type>Module</type>
Expand Down
8 changes: 4 additions & 4 deletions src/Helper/SimpleIsotopeHelper.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
/**
* Simple isotope module - Joomla Module
* Version : 4.3.19
* Version : 4.3.20
* Package : Joomla 4.x/5.x
* copyright : Copyright (C) 2024 ConseilGouz. All rights reserved.
* license : https://www.gnu.org/licenses/gpl-3.0.html GNU/GPL
Expand Down Expand Up @@ -185,7 +185,7 @@ public static function getWebLinksCategorie($id, $alias, $introtext_img, $wl_par
}
}
}
$authorised = Access::getAuthorisedViewLevels(Factory::getUser()->get('id'));
$authorised = Access::getAuthorisedViewLevels(Factory::getApplication()->getIdentity()->get('id'));
$article_tags[$item->id] = self::getWebLinkTags($item->id, $authorised); // article's tags
foreach ($article_tags[$item->id] as $tag) {
if (!in_array($tag->tag, $tags)) {
Expand Down Expand Up @@ -263,7 +263,7 @@ public static function getItems($categories, $params, $tags_list, &$tags, &$tags
$articles->setState('list.limit', $limit);
$articles->setState('filter.published', 1);
$access = true; // check user access level
$authorised = Access::getAuthorisedViewLevels(Factory::getUser()->get('id'));
$authorised = Access::getAuthorisedViewLevels(Factory::getApplication()->getIdentity()->get('id'));
$articles->setState('filter.access', $access);
$articles->setState('filter.viewlevels', $authorised);
$catids = $categories;
Expand Down Expand Up @@ -1043,7 +1043,7 @@ public static function getArticle($id, $modparams)

// Access filter
$access = ComponentHelper::getParams('com_content')->get('show_noauth');
$authorised = Access::getAuthorisedViewLevels(Factory::getUser()->get('id'));
$authorised = Access::getAuthorisedViewLevels(Factory::getApplication()->getIdentity()->get('id'));
$model->setState('filter.access', $access);

// Filter by language
Expand Down

0 comments on commit 2070814

Please sign in to comment.