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
Avoid displaying the addon modal twice, change form names/IDs to avoid collision #10684
Changes from all commits
77445bb
d683b08
ab2d60f
433ec4a
ce18054
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1786,7 +1786,7 @@ public function display() | |
$header_tpl = file_exists($dir . 'header.tpl') ? $dir . 'header.tpl' : 'header.tpl'; | ||
$page_header_toolbar = file_exists($dir . 'page_header_toolbar.tpl') ? $dir . 'page_header_toolbar.tpl' : 'page_header_toolbar.tpl'; | ||
$footer_tpl = file_exists($dir . 'footer.tpl') ? $dir . 'footer.tpl' : 'footer.tpl'; | ||
$modal_module_list = file_exists($module_list_dir . 'modal.tpl') ? $module_list_dir . 'modal.tpl' : 'modal.tpl'; | ||
$modal_module_list = file_exists($module_list_dir . 'modal.tpl') ? $module_list_dir . 'modal.tpl' : ''; | ||
$tpl_action = $this->tpl_folder . $this->display . '.tpl'; | ||
|
||
// Check if action template has been overridden | ||
|
@@ -1826,9 +1826,15 @@ public function display() | |
$this->context->smarty->assign( | ||
array( | ||
'page_header_toolbar' => $this->context->smarty->fetch($page_header_toolbar), | ||
'modal_module_list' => $this->context->smarty->fetch($modal_module_list), | ||
) | ||
); | ||
if (!empty($modal_module_list)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With the ternary condition, $modal_module_list is never empty There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes an empty string returns true, that's the point of the test There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Oh my bad, miss reading the diff and thinking the ternary was: file_exists($module_list_dir . 'modal.tpl') ? $module_list_dir . 'modal.tpl' : 'modal.tpl'; There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes that was the previous ternary, but with the new template it no longer has the wanted behavior and instead of adding a modal for available modules (which does not exist in the new theme) it resulted in including the addon login modal in two different locations |
||
$this->context->smarty->assign( | ||
array( | ||
'modal_module_list' => $this->context->smarty->fetch($modal_module_list), | ||
) | ||
); | ||
} | ||
} | ||
|
||
$this->context->smarty->assign('baseAdminUrl', __PS_BASE_URI__ . basename(_PS_ADMIN_DIR_) . '/'); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reducing the visibility of this variable may break some compatibility.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
well it actually enhance it since it is visible by root and not only parent
without this the couting can't work because the two forms don't have the same immediate parent