Campaign module - issues with description field

In the campaign module, we cannot edit and save the description field from the detail view. (In studio, in-line edit is enabled).

We checked it on demo version too. We observed same issues on it. Please help to resolve these issues.

Here is snapshot to see details.

Also. why we don’t have Edit button option for campaign record? :thinking:

Here’s what shows up in console:

Uncaught TypeError: $(...)[0].setSelectionRange is not a function
    at onInlineEditDblClick (inlineEditing.js:183:39)
    at HTMLTableCellElement.<anonymous> (inlineEditing.js:219:9)
    at HTMLTableCellElement.dispatch (sugar_grp1_jquery.js?v=282ESmkcqJ5vm6vlQ_hxfw:2:43064)
    at v.handle (sugar_grp1_jquery.js?v=282ESmkcqJ5vm6vlQ_hxfw:2:41048)
    at HTMLTableCellElement.c (rocket-loader.min.js:1:9405)

Yes!

I can see that this issue is persist throughout the SuiteCRM versions.

If you notice, there is also two different description fields that you can add to the list view. That’s kind of wierd too.

Hmmmmmmmmm yeah! two description fields with DB names as content & description. That’s strange! Someone is wrong.

Also, story continues to Popup view and Filter options too.

The following changes helped me to fix this.

  1. Make description field editable (content for campaigns module) in vardefs.php to display the pencil icon at
    modules/Campaigns/vardefs.php by setting 'inline_edit' => true,
 'content' => array(
            'name' => 'content',
            'vname' => 'LBL_CAMPAIGN_CONTENT',
            'type' => 'text',
            'comment' => 'The campaign description',
            'inline_edit' => true,
        ),
  1. ‘setSelectionRange is not a function’ error, comment line no 183
    image

  2. id ‘content’ is the culprit causing the issue since there might be multiple html tags with this id. so made the change to get the textarea with this id from ‘EditView’ form in ‘getInputValue’ function at line no. 444 & 445

  default:
                if ($('#EditView').find("#" + field).val().length > 0) {
                    return $('#EditView').find("#" + field).val();
                }

image

2 Likes

PATH:

include/InlineEditing/inlineEditing.js


PATH:

include/InlineEditing/inlineEditing.js