Case Updates not saving text

@RiaanB

Where did you loosing custom fields? You wrote correct file for system or custom directory.
I see only one mistake in full name of custom file. There is space character " " in “…custom/ modules…” .

Hi was a typo

If I copy /SuiteCRM/SuiteCRM-7.11.13/modules/Cases/metadata/detailviewdefs.php to /SuiteCRM/SuiteCRM-7.11.13/custom/modules/Cases/metadata/detailviewdefs.php

then I loose my custom fields but it solves my problem of saving cases updates .

The code above is the code for the custom/modules/Cases/metadata/detailviewdefs.php

I would like to know what is wrong with that code that it does not work

@RiaanB
Did you do “Quick Repair and Rebuild” after copy?

yes , the custom fields do not come back

@RiaanB If it were me I would probably copy the unmodified version to the custom directory so that case updates work and then I would add your custom code in sections until it stops updating. (I would do this for you but I’m still using 7.10.) I did run a file compare between a fresh copy from 7.11.18 and your customized file and your changes wouldn’t be difficult to add back in section by section. I do question the last two lines which I do not believe should be there. Generally SuiteCRM php files contain the <?php tag at the beginning but do not include the end tag. Maybe try removing the last two lines.

;
?>

@RiaanB
For testing. You can add to file custom/modules/Cases/metadata/detailviewdefs.php next line:

<?php
$GLOBALS['log']->fatal(get_class()." ". __FUNCTION__." this->metadataFile: ".print_r($this->metadataFile,true));
$viewdefs ['Cases'] = 
...

If you see in suitecrm.log the line:

Sat Mar 20 11:22:01 2021 [19417][1][FATAL] DetailView2  this->metadataFile: custom/modules/Cases/metadata/detailviewdefs.php

then you have problems in structure array, but i think that problem in full name of file, check all symbols.

The closing tag ; ?> is irrelevant.

Thank you much appreciated , I will review again and follow your advise