Empty textarea versus empty text

  • Hi,


    Quick question about textarea and texttypes


    I've two test IDs in my page template

    1. <perch:content no-index id="textarea_test" type="textarea" label="Text area">
    2. <perch:content no-index id="text_test" type="text" label="Text">

    Before I add any content to them, I can use var_dump to see both are set to NULL

    • ["textarea_test"]=> NULL
    • ["text_test""]=> NULL

    If I add some test text and check var_dump again I can see this:

    • ["textarea_test"]=> string(21) "Test text in textarea" 
    • ["text_test"]=> string(17) "Test text in text"

    When I delete the text in both IDs only text_test returns to NULL, textarea_test returns string(0) ""  instead.

    • ["textarea_test"]=> string(0) "" 
    • ["text_test"]=> NULL


    The different way the textarea and texttypes work when content is deleted (via the CMS) threw me today. I was using isset to check the value of an ID. I added some text, then deleted it. The ID was empty, I checked with showall but because it wasn't NULL it wasn't working as expected.


    Just wondering if the textarea should also revert to NULL the same way text does?




    Summary information