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

Parents Reply Children
  • 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!