Detail View showing old data for duplicated form entries

By: Na Lee | Asked: 10/24/2022
ForumsCategory: Code HelpDetail View showing old data for duplicated form entries
Na Lee asked 1 year ago
When a form entry is duplicated, I update the data to change the date to the current date with a php function:   add_shortcode( \'duplicate_entry_form\', \'frm_duplicate_entry_form\' );   function frm_duplicate_entry_form( $atts ) {    $old_id = $atts[\'entry_id\'];        if ( ! empty( $old_id ) && ! is_numeric( $old_id ) ) {                $old_id = absint( $_GET[ $old_id ] );      }        $new_entry_id = FrmEntry::duplicate( $old_id );     $updated = FrmEntryMeta::add_entry_meta($new_entry_id, 270, null, date(\'Y-m-d\'));     if (!$updated){         FrmEntryMeta::update_entry_meta($new_entry_id, 270, null, date(\'Y-m-d\'));     }     return FrmFormsController::get_form_shortcode( array(\'id\' => $atts[\'id\'], \'entry_id\' => $new_entry_id ) ); }       The table view shows the correct updated data, however the detail view shows the old date. When looking at the entries page in the backend, the date is correct. It’s only the detail view which is wrong.   What could be causing this discrepancy? If the table and detail views read from the same table, is there a way to force the detail view to fetch new data?
1 Answers
Bobby Clapp answered 1 year ago
Is there a reason you aren't using updated_at?

Making the Best WordPress Plugin even better - Together

Take on bigger projects with confidence knowing you have access to an entire community of Formidable Experts and Professionals who have your back when the going gets tough. You got this!
Join the community