1

I inherited a site that was grossly outdated and have been systematically upgrading the WP Core and its plugins so that it is mostly up to date. However I am now receiving and error on one of my custom admin pages that I have been unable to debug this Dev Tools. I

error popup

When debugging WP all I am receiveing is

<b>Notice</b>:  Trying to access array offset on value of type bool in <b>/www/dreamrides_499/public/wp-content/themes/understrap-child/admins/custom_admin_header.php</b> on line <b>24</b><br />

This however is unrelated as it refers to a meta field reference.

<?php if(get_field( 'profile_image', 'user_'.get_current_user_id().'' )['url']): ?>

The error itself relates to the booking plugin

<script id='wc_bookings_admin_edit_booking_js-js-extra'>
var wc_bookings_admin_edit_booking_params = {"invalid_start_end_date":"\"Start and end date\" should be of the format yyyy-mm-dd and cannot be empty.","date_range_invalid":"Start date cannot be greater than end date."};
</script>

Any assistance here would be a great help.

designmode
  • 143
  • 2
  • 12
  • As the alert clearly indicates that you need to format the date you are using in the page YYYY-MM-DD have you done that? – ashokostech Jun 07 '22 at 06:06
  • I have replaced `$startDate = DateTime::createFromFormat('d/m/Y g:i a', get_field('booking_start_date', $post_id));` with `$startDate = DateTime::createFromFormat('Y-m-d H:i:s', get_field('booking_start_date', $post_id));` however it still doesnt seem to work. – designmode Jun 07 '22 at 18:23

0 Answers0