Suite P bug with delete confirmation dialogue

see gitub bug report https://github.com/salesagility/SuiteCRM/issues/2862 (i did think at first it was a bug in general but then i thought of trying other themese)

2 Likes

A PR has been opened for this that fixes the issue. The code will now just need to be reviewed before it gets pulled into the product. Thanks for raising this issue :slight_smile:

1 Like

So this is an old issue, but I’m hoping someone can help me. I’m still experiencing this behavior on 7.10.21 (after updates getting me to this version) for the projects module. I’m assuming some ‘custom’ code is overriding the smarty, but I’m unable to determine where that is to revert it back to the smarty… or alternatively, update the custom code to work properly with the confirmation.

Barely related, the ‘Cancel’ button does not work in Projects>Edit View if you use on the one on the bottom of the page rather than the top. This is true on a clean install of 7.10.21 as well.

I resolved this issue by editing detailviewdefs.php in custom/modules/Project/metadata:

    'includes' => 
array (
  0 => 
  array (
    'file' => 'modules/Project/Project.js',
  ),
),

to

    'includes' => 
array (
  0 => 
  array (
    'file' => 'modules/Project/Project.js',
  ),
  1 =>
      array(
          'file' => 'modules/Project/js/custom_project.js',
      ),
),

and

        1 => 
    array (
      'customCode' => '<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" type="button" name="Delete" id="delete_button" value="{$APP.LBL_DELETE_BUTTON_LABEL}"onclick="{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesListView\'; this.form.action.value=\'Delete\'; if( confirm(\'{$APP.NTC_DELETE_CONFIRMATION}\') )  this.form.submit(); {else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ListView\'; this.form.action.value=\'Delete\'; if( confirm(\'{$APP.NTC_DELETE_CONFIRMATION}\'))  this.form.submit(); {/if}"/>',
      'sugar_html' => 
      array (
        'type' => 'button',
        'id' => 'delete_button',
        'value' => '{$APP.LBL_DELETE_BUTTON_LABEL}',
        'htmlOptions' => 
        array (
          'title' => '{$APP.LBL_DELETE_BUTTON_TITLE}',
          'accessKey' => '{$APP.LBL_DELETE_BUTTON_KEY}',
          'id' => 'delete_button',
          'class' => 'button',
         'onclick' => '{if $IS_TEMPLATE}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ProjectTemplatesListView\'; this.form.action.value=\'Delete\'; if (confirm(\'{$APP.NTC_DELETE_CONFIRMATION}\')) this.form.submit();{else}this.form.return_module.value=\'Project\'; this.form.return_action.value=\'ListView\'; this.form.action.value=\'Delete\'; if (confirm(\'{$APP.NTC_DELETE_CONFIRMATION}\')) this.form.submit();{/if}',
        ),
      ),
    ),

to

    1 => 
    array (
      'customCode' => '<input title="{$APP.LBL_DELETE_BUTTON_TITLE}" accessKey="{$APP.LBL_DELETE_BUTTON_KEY}" class="button" type="button" name="Delete" id="delete_button" value="{$APP.LBL_DELETE_BUTTON_LABEL}" onclick="project_delete(this);"/>',
      'sugar_html' => 
      array (
        'type' => 'button',
        'id' => 'delete_button',
        'value' => '{$APP.LBL_DELETE_BUTTON_LABEL}',
        'htmlOptions' => 
        array (
          'title' => '{$APP.LBL_DELETE_BUTTON_TITLE}',
          'accessKey' => '{$APP.LBL_DELETE_BUTTON_KEY}',
          'id' => 'delete_button',
          'class' => 'button',
          'onclick' => 'project_delete(this);',
        ),
      ),
    ),