Drupal 7 field cache problems
Hello, I am working on a element and am having a lot of problems.
I have a form which has a hidden custom element on it. The element is basically a hidden status, which I am using to read to perform other functions. When the form is initially opened, the field defaults to "Not in Review".
After save, I have other code which appropriately changes the value in the table to "In Review" using the following code within a function.
->fields(array( 'field_proj_status_project_status_value' => 'In Review'))
I can double check the database directly and the field appropriately says "In Review"
However, when I load the content page again (view) the field says "Not in Review". Then when I "Edit and Save" it automatically changes it again to "Not in Review".
I think this is happening because the content seems to be caching on the user side.
If I perform the same procedures by Creating content and checking database to confirm value was appropriately changed to "In Review" that works. Then if I hit "Empty Cache" button, the cache clears. Then if I view the content it appropriately says "In Review" and if I edit and save, the value never changes to "Not in Review".
So I know this is a cache problem.
Does anyone know code that I can use which will not cache a specific field? Or how I can prevent this problem?
Basically I need a field which I can change automatically after save. Then if it is edited and saved again, I cannot have it revert back to the original status.
Here is the code of how I am building the element through the custom form.module file within the widget.form
$element['project_status_value'] = array(
'#type' => 'hidden',
'#title' => t('Project Status:'),
'#default_value' => isset($items[$delta]['project_status_value']) ? $items[$delta]['project_status_value'] : 'Not in Review',
Thanks in advance