Skip to content

Commit ef1d550

Browse files
authored
Import content plugin for weblink view
* Import content plugin for weblink view * Allow downgrade * Typo, we want to allow downgrade
1 parent 7694b4c commit ef1d550

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

src/administrator/components/com_weblinks/src/Controller/WeblinkController.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ protected function allowAdd($data = [])
6363
*/
6464
protected function allowEdit($data = [], $key = 'id')
6565
{
66-
$recordId = (int) isset($data[$key]) ? $data[$key] : 0;
66+
$recordId = isset($data[$key]) ? (int) $data[$key] : 0;
6767

6868
// Since there is no asset tracking, fallback to the component permissions.
6969
if (!$recordId) {

src/administrator/manifests/packages/weblinks/script.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,16 @@
2121
*/
2222
class Pkg_WeblinksInstallerScript extends InstallerScript
2323
{
24+
/**
25+
* Allow downgrades of your extension
26+
*
27+
* Use at your own risk as if there is a change in functionality people may wish to downgrade.
28+
*
29+
* @var boolean
30+
* @since __DEPLOY_VERSION__
31+
*/
32+
protected $allowDowngrades = true;
33+
2434
/**
2535
* Extension script constructor.
2636
*

src/components/com_weblinks/src/View/Weblink/HtmlView.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
use Joomla\CMS\Factory;
1414
use Joomla\CMS\MVC\View\GenericDataException;
1515
use Joomla\CMS\MVC\View\HtmlView as BaseHtmlView;
16+
use Joomla\CMS\Plugin\PluginHelper;
1617
use Joomla\Component\Weblinks\Site\Model\WeblinkModel;
1718

1819
// phpcs:disable PSR1.Files.SideEffects
@@ -74,6 +75,8 @@ public function display($tpl = null)
7475
$this->handleModelErrors($errors);
7576
}
7677

78+
PluginHelper::importPlugin('content');
79+
7780
// Create a shortcut for $item.
7881
$item = $this->item;
7982
$item->slug = $item->alias ? ($item->id . ':' . $item->alias) : $item->id;

0 commit comments

Comments
 (0)