Upgrade safe way to disable WYSIWYG editor from Cases

Does anyone know the correct and upgrade safe way to customise the Cases module vardefs.php?

I’m a little confused as to how to do this. Is it as simple as copying the file into the ./custom directory ( as below)?
e.g. ./custom/modules/Cases/vardefs.php

What I’m trying to do is disable the WYSIWYG editor from appearing in the cases module as it currently leaves html tags around the description field when in view mode (as opposed to edit).

I can currently get the affect that I want by commenting out the ‘editor’ line in vardefs, see below:

'description' => array(
            'name' => 'description',
            'vname' => 'LBL_DESCRIPTION',
            'type' => 'text',
            //'editor' => 'html',
            'comment' => 'Full text of the description',
            'rows' => 6,
            'cols' => 80,
        ),

You would use the Extension Framework

https://docs.suitecrm.com/developer/extension-framework/#_standard_extensions

see the extension type for vardefs in that table.

You can use a PHP “unset” command to remove an entry. Note that in the extension framework, you just specify what you need to change, not everything. So your file won’t have a full copy of the vardefs, but only a single line with an “unset” for the editor. Needs a QR & R to take effect.

Perfect! Thanks for pointing me in the right direction, I think I understand now.

Do you mind quickly checking my syntax and file location here? I think I’ve done “almost” everything correctly, I just seem to be missing that special something to get it to actually work now.

So I’ve created a php file that’s executable below (as per the docs example 4.5):

./custom/Extension/modules/Cases/Ext/my_design.php

I’ve put the following code into it:

<?php
unset($dictionary['Case']['fields']['description']['editor']);
unset($dictionary['Case']['fields']['update_text']['editor']);
?>

Then I run a quick repair and rebuild.

Can you see what I’m doing wrong?

That looks about right…

First, look under

custom/modules/Cases/Ext/Vardefs

to see if your change got picked up and appears there

Thanks for taking a look! It reassured me I wasn’t going completely mad. The problem was that the path was incorrect and something that may need adjusted in the documentations example.

The example shows:

custom/Extension/modules//Ext/SomeFile.php

But what worked was:

custom/Extension/modules//Ext/Vardefs/SomeFile.php

Thanks again for your help though :slight_smile:

Ok, fixed

https://github.com/salesagility/SuiteDocs/commit/0bf678b938e57f4f80c1db1444fc9ef3680b15a9

thanks

1 Like