AJAX Attribute Manager

Fixes for 1.0.8.1 - AJAX Attribute Manager

Fixes for 1.0.8.1

by vmn » Wed Apr 14, 2021 9:33 am

For those who are running 1.0.8.1, at least the following fixes are needed:

admin/attributeManager/includes/attributeManagerPrompts.inc.php

function yesNoButtons($section) {
return '
<div class="popupFooter">' .
//VMN pre 1.0.8.1 tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash', null, 'primary', ['params' => 'onClick="return ' . $section . '();"'], 'btn-danger') . '&nbsp;' .
tep_draw_bootstrap_button(IMAGE_DELETE, 'fas fa-trash', null, 'primary', ['onClick' => "return " . $section . "();"], 'btn-danger') . '&nbsp;' .
//VMN pre 1.0.8.1 tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', null, '', ['params' => 'onClick="removeCustomPrompt();"'], 'btn-light') .
tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', null, '', ['onClick' => 'removeCustomPrompt();'], 'btn-light') .
'</div>';
}

function updateCancelButtons($section) {
return '
<div class="popupFooter">' .
//VMN pre 1.0.8.1 tep_draw_bootstrap_button(IMAGE_SAVE, 'fas fa-save', null, 'primary', ['params' => 'onClick="return ' . $section . '();"'], 'btn-success') . '&nbsp;' .
tep_draw_bootstrap_button(IMAGE_SAVE, 'fas fa-save', null, 'primary', ['onClick' => "return " . $section . "();"], 'btn-success') . '&nbsp;' .
//VMN pre 1.0.8.1 tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', null, '', ['params' => 'onClick="removeCustomPrompt();"'], 'btn-light') .
tep_draw_bootstrap_button(IMAGE_CANCEL, 'fas fa-times', null, '', ['onClick' => 'removeCustomPrompt();'], 'btn-light') .
'</div>';
}
vmn
Posts: 40
Joined: Mon Mar 08, 2021 8:59 am
Contact:

Re: Fixes for 1.0.8.1

by artfulweb » Thu Apr 22, 2021 8:35 am

Sorry, I just tried your fix and can not delete the attribute... the delete button does nothing.
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Contact:

Re: Fixes for 1.0.8.1

by vmn » Fri Apr 23, 2021 9:05 am

Sorry, I did not test throgouhly enough. In addition to onclick fixes, the following is needed.

It seems that the new html element object implementation in 1.0.8.1 does not like white space in element parameters.

Original (in attributeManagerPrompts.inc.php):
$amPopup->addToContents(tep_draw_hidden_field('option_id', $arrExtraValues['option_id'], 'id = "option_id"'));

Fix:
$amPopup->addToContents(tep_draw_hidden_field('option_id', $arrExtraValues['option_id'], 'id="option_id"'));

You should fix all similar white space occurrences. In some cases there is a space only after the equal sign.

Looks like there will be quite a lot rewriting needed to get 1.0.8.1 to work properly.
Last edited by vmn on Fri Apr 23, 2021 12:17 pm
vmn
Posts: 40
Joined: Mon Mar 08, 2021 8:59 am
Contact:

Re: Fixes for 1.0.8.1

by artfulweb » Fri Apr 23, 2021 9:40 am

vmn wrote:Sorry, I did not test throgouhly enough. In addition to onclick fixes, the following is needed.

It seems that the new html element oject implementation in 1.0.8.1 does not like white space in element parameters.

Original (in attributeManagerPrompts.inc.php):
$amPopup->addToContents(tep_draw_hidden_field('option_id', $arrExtraValues['option_id'], 'id = "option_id"'));

Fix:
$amPopup->addToContents(tep_draw_hidden_field('option_id', $arrExtraValues['option_id'], 'id="option_id"'));

You should fix all similar white space occurrences. In some cases there is a space only after the equal sign.

Looks like there will be quite a lot rewriting needed to get 1.0.8.1 to work properly.

THANK YOU SO MUCH! That worked.
artfulweb
VIP Member
VIP Member
Posts: 119
Joined: Thu Oct 29, 2020 12:34 pm
Contact: