Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixes module not installing from new catalog page #481

Merged
merged 1 commit into from
Dec 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@
{else}
{$element->description|truncate:90:"..."}
{/if}
{* <a href="{if $element->element_type == $element_type_module}{$currentIndex|escape:'html':'UTF-8'}&amp;token={$token|escape:'html':'UTF-8'}&amp;ajax=1&amp;action=GetModuleQuickView&amp;module={$element->name|urlencode}{else}{$element->addons_buy_url|replace:' ':'+'|escape:'html':'UTF-8'}{/if}" class="fancybox-quick-view pull-right">{l s='Read more'}</a> *}
</p>
<div class="panel-action clearfix">
{if isset($element->type) && $element->type == 'addonsMustHave' && $element->not_on_disk}
<span class="module-price">{if isset($element->price)}{if $element->price|floatval == 0}{l s='Free'}{elseif isset($element->id_currency)}{displayPrice price=$element->price currency=$element->id_currency}{/if}{/if}</span>
<a class="btn button-action pull-right btn-primary _blank" href="{$element->addons_buy_url|replace:' ':'+'|escape:'html':'UTF-8'}">{l s='Explore'}</a>
{else}
{* <a class="btn button-action pull-right btn-primary{if !$element->trusted} untrustedaddon{/if}" {if !$element->trusted} data-target="#moduleNotTrusted" data-toggle="modal"{/if} data-link="{$element->options.install_url|escape:'html':'UTF-8'}" data-module-display-name="{$element->displayName|escape:'html':'UTF-8'}" data-module-name="{$element->name|escape:'html':'UTF-8'}" data-module-image="{if isset($element->image)}{$element->image}{else}{$modules_uri}/{$element->name}/{$element->logo}{/if}" data-author-name="{$element->author|escape:'html':'UTF-8'}" data-author-uri="{if isset($element->author_uri)}{$element->author_uri|escape:'html':'UTF-8'}{/if}" href="{if !$element->trusted}#{else}{$element->options.install_url|escape:'html':'UTF-8'}{/if}" title="{l s='Install'}">{l s='Install'}</a> *}
<a class="btn button-action pull-right btn-primary" data-link="{$element->options.install_url|escape:'html':'UTF-8'}" data-module-display-name="{$element->displayName|escape:'html':'UTF-8'}" data-module-name="{$element->name|escape:'html':'UTF-8'}" data-module-image="{if isset($element->image)}{$element->image}{else}{$modules_uri}/{$element->name}/{$element->logo}{/if}" data-author-name="{$element->author|escape:'html':'UTF-8'}" data-author-uri="{if isset($element->author_uri)}{$element->author_uri|escape:'html':'UTF-8'}{/if}" href="#" title="{l s='Install'}">{l s='Install'}</a>
<a class="btn button-action pull-right btn-primary{if !$element->trusted} untrustedaddon{/if}" {if !$element->trusted} data-target="#moduleNotTrusted" data-toggle="modal"{/if} data-link="{$element->options.install_url|escape:'html':'UTF-8'}" data-module-display-name="{$element->displayName|escape:'html':'UTF-8'}" data-module-name="{$element->name|escape:'html':'UTF-8'}" data-module-image="{if isset($element->image)}{$element->image}{else}{$modules_uri}/{$element->name}/{$element->logo}{/if}" data-author-name="{$element->author|escape:'html':'UTF-8'}" data-author-uri="{if isset($element->author_uri)}{$element->author_uri|escape:'html':'UTF-8'}{/if}" href="{if !$element->trusted}#{else}{$element->options.install_url|escape:'html':'UTF-8'}{/if}" title="{l s='Install'}">{l s='Install'}</a>
{/if}
</div>
</div>
Expand Down
1 change: 1 addition & 0 deletions classes/controller/AdminController.php
Original file line number Diff line number Diff line change
Expand Up @@ -2243,6 +2243,7 @@ public function ajaxProcessRefreshModuleList($force_reload_cache = false)
} else {
$this->status = 'cache';
}
Module::generateTrustedXml();
}

/**
Expand Down
3 changes: 3 additions & 0 deletions classes/module/Module.php
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,7 @@ public static function getModulesOnDisk($use_config = false, $logged_on_addons =
$item->active = 0;
$item->onclick_option = false;
$item->url = false;
$item->trusted = Module::isModuleTrusted($item->name, false);
$item->is_native = false;

if (defined('_PS_HOST_MODE_') && in_array($item->name, self::$hosted_modules_blacklist)) {
Expand Down Expand Up @@ -1443,6 +1444,7 @@ public static function getModulesOnDisk($use_config = false, $logged_on_addons =
$item->is_configurable = $tmp_module->is_configurable = method_exists($tmp_module, 'getContent') ? 1 : 0;
$item->need_instance = isset($tmp_module->need_instance) ? $tmp_module->need_instance : 0;
$item->active = $tmp_module->active;
$item->trusted = Module::isModuleTrusted($tmp_module->name, false);
$item->currencies = isset($tmp_module->currencies) ? $tmp_module->currencies : null;
$item->currencies_mode = isset($tmp_module->currencies_mode) ? $tmp_module->currencies_mode : null;
$item->confirmUninstall = isset($tmp_module->confirmUninstall) ? html_entity_decode($tmp_module->confirmUninstall) : null;
Expand Down Expand Up @@ -1629,6 +1631,7 @@ public static function getSuggestedModules()
$item->need_instance = 0;
$item->not_on_disk = 1;
$item->available_on_addons = 1;
$item->trusted = Module::isModuleTrusted($item->name, false);
$item->active = 0;
$item->description_full = stripslashes($modaddons->description_full);
$item->additional_description = isset($modaddons->additional_description) ? stripslashes($modaddons->additional_description) : null;
Expand Down