How to remove html tags from a textarea?

Hi everyone

We have an opportunity module which has a workflow copying opportunities.notes and creating and setting meetings.notes textarea. Whats happening is the new lines or line returns are being copied over as <br /> text.

Is there a way to stripe this out? also I'm hoping it an option somewhere and not a logic-hook method.

Thanks

BR tags

  • Hi sonesay inthavong,

    Please provide details around how you are copying the field content.

    In 8.3.0 Enterprise, I created a Process Definition that copied the Opportunity's Description field to the Meetings Description field, and the line breaks transferred as expected.

  • Hi Patrick, here's the workflow design view below. Its copying a few fields that make up the notes but the problem field seems to be Additional Notes =  (Opportunities::description) (This was just relabled)where line returns in this field here seem to come through as <br /> tags.

    We are currently hosted on site and running SugarCRM version 8.0.1

    Thanks

  • Hi sonesay inthavong,

    The following is not upgrade safe nor supported nor recommended, but I offer the following for discussion and information sake.

    In the core file: modules/pmse_Inbox/engine/PMSEHandlers/PMSEBeanHandler.php
    Around line 232, you might find the following:

    foreach ($replace_array as $name => $replacement_value) {
    $template = str_replace($name, $replacement_value, $template);
    }
    return $template;

    In a test environment, changing it to the following, running a Quick Repair and Rebuild, I do not expect the issue to reoccur:

    foreach ($replace_array as $name => $replacement_value) {
    $replacement_value = nl2br($replacement_value);
    $template = str_replace($name, $replacement_value, $template);
    }
    return $template;

    This function is significantly changed in Winter'19 (8.3.0). The described issue is not reproducible there.

    The code in Winter'19 (8.3.0) is expected to roll up to Spring'19 (9.0.0) which I tentatively expect will be released in approximately 3 months.

    Because the changes to this function are quite different, I do not recommend patching this in the custom directory and/or leaving the above customizations in place after upgrading to Spring'19 (9.0.0).

    If you patch this in the core file you host, an upgrade will automatically wipe out the changes, replacing the file with with the new version.

    If you patch it in the custom directory, I would recommend making note of the change and removing it once you upgrade to Spring'19 (9.0.0).

    I hope this helps!

  • Patrick McQueen 's workaround is nice, but I believe you can extend the Advanced Workflow in order to accomplish such workaround in an upgrade safe way and packageScan safe way.

    Regards

    André Lopes
    Lampada Global
    Skype: andre.lampada