Jump to content

  • You cannot start a new topic
  • You cannot reply to this topic

Bug With Cm-Confirm? Rate Topic   - - - - -

 
  • Oscar
  • Advanced Member
  • Members
  • Join Date: 26-May 16
  • 50 posts

Posted 05 August 2016 - 02:31 AM #1

I am enabling the "confirm" flag within the select_popup.tpl to have the user confirm a change in the product status while on the products.manage controller. However, even though the confirmation message is displayed, and it is functionally working (when selecting no changes are not saved). Visually the selection still changes which I believe is a bug.

 

So for example,

  1. The user changes the product status from Active to Hidden. 
  2. A message requesting confirmation is shown
  3. The user cancels
  4. Changes are not saved (intended)
  5. Visually it looks as if the change was made (bug?)
  6. Refreshing the page shows that the changes were not actually performed (intended) 

 

My question is, is cm-confirm just not meant to be used here, or is this a bug?



 
  • patroklos
  • Newbie
  • Members
  • Join Date: 13-Jun 19
  • 5 posts

Posted 17 October 2019 - 09:45 AM #2

It seems, this has not been fixed yet



 
  • patroklos
  • Newbie
  • Members
  • Join Date: 13-Jun 19
  • 5 posts

Posted 17 October 2019 - 01:18 PM #3

In case anybody needs this:

 

I managed to add a confirmation alert for order status change (same as cm-confirm) by:

 

 - creating my own select_popup.tpl by using an addon

 - not using the cm-confirm helper

 - replacing (in the custom select_popup.tpl) :

onclick="return fn_check_object_status(this, '{$st|lower}', '{if $statuses}{$statuses[$st].params.color|default:''}{/if}');"

with: 

onclick="return li_click(event, this, '{$st|lower}', '{if $statuses}{$statuses[$st].params.color|default:''}{/if}', '{__($confirmText,['[status]'=>$val])|escape}')"

and the li_click function:

<script>function wf_li_click(event, dom, b, c, confirmText){
    if( confirm(confirmText) ){
        return fn_check_object_status(dom, b, c);
    }else{
        event.preventDefault();
        event.stopPropagation();
        $('body').trigger('click'); //close dropdown
        return false;
    }
}</script>