Smarty error after Repair

After doing a repair I’m not able to view/edit records. I tracked the problem down to the cache folder “cache/modules/MODULENAME/DetailView.tpl”.

The fix is super simple but I can’t find where this is being generated from. Within that file there’s incorrect code:

{if !$fields.myfield_c.hidden} {counter name="panelFieldCount"} {if strlen($fields[b]..[/b]value) <= 0} {assign var="value" value=$fields[b]..[/b]default_value } {else} {assign var="value" value=$fields[b]..[/b]value } {/if} {$fields[b]..[/b]value} {/if}

A quick find/replace of all … to . is all that’s needed to fix things. this is also happening on the EditView

any ideas?

its likely a custom field that has been deleted from the system, still defined in the views/ there is a vardef ext still defined for it,

look in custom/extension/modules/Ext/MODULENAME/vardefs/ or custom/modules/MODULENAME/metadata

1 Like

Thanks Matt. I was able to get things to work by deleting the field under edit/details view. I spotted that the field was listed twice (and confirmed they were indeed the same field). New problem, and not sure if it’s related to what you replied with, if I click edit and save my log file is kicking back an MYSQL error. it looks as if the custom table isn’t being added to the query. I am seeing “=NULL” within the log file error and it happens at the very first field of the custom table.

you have a deleted field which still has a definition in the extension vardefs,

custom/extension/modules/MODULENAME/Ext/vardefs/

delete the deleted fields definition and do quick repair and rebuild

1 Like

Cool, everything now works. FYI I wasn’t sure if the problematic field needed to be commented out (my first approach) or the actual file deleted. Commenting out the field in the appropriate cache folder worked however repairing/fixing the site created the problem again (/cache/modules/SPS01_Poolsites/MyMODULENAMEvardefs.php). I located the field within the location you pointed out but simply commenting out the lines of code didn’t work so i deleted the file all together (/custom/Extension/modules/MyMODULENAME/Ext/Vardefs/MyFIELDNAME.php). Another thing worth mentioning for others stumbling upon this post is that the problematic field was not deleted from Studio but simply removed from the Detail/Edit views.

Thanks for you help.