June 13, 2016 at 1:41 pm #6667jivedigMember
Any website I use Piklist (trunk, haven’t tried repo version) has a “Trying to get property of non-object” via Query Monitor.
It appears to only happen when trying to add a new (custom post type) post. I tested on Twenty Sixteen theme and various Genesis child themes and the error remains.
Attachments:You must be logged in to view attached files.
June 15, 2016 at 11:00 am #6681JasonKeymaster
touch_timefunction isn’t used by a theme; it’s an admin-side function, so changing themes (as you found) wouldn’t have any affect. Still, I just tried this out locally and I’m not having the same issue. Perhaps something is misconfigured where you’re defining the post type?
Have you tried debugging the line in template.php to see if you can get more information on the variable that’s supposed to be an object?
August 3, 2016 at 3:36 am #7072
August 3, 2016 at 3:45 am #7073vavakcoMember
I just happen to common problem, but I really don’t know why !!?
with load_textdomain_mofile filter, change some plugin but when disable this function there was not error to be publish post. i just replace .mo file with default piklist language address.
Who has the problem?
October 20, 2016 at 2:02 am #7449mindmantraParticipant
Hi, Had the same issue.
The culprit is touch_time args passed in
piklist\parts\meta-boxes\submitdiv.php line 218
touch_time(($action == 'edit'), ($pagenow != 'post-new.php'), 4)
This metabox is extending and “replacing” the
wp-admin\includes\meta-boxes.php. If I’m not wrong this is only available in custom-post-types set by piklist function to add support for custom post statuses.
Here’s the core issue, while original metabox in wp-admin sets
touch_time( ( $action === 'edit' ), 1 );replaced one in custom metabox by piklist tries to be smart to see if it’s NOT(?) on post-new.php page (are the datetime form fields are for-post or for-comments).
Here’s the actual function being called
touch_time( $edit = 1, $for_post = 1, $tab_index = 0, $multi = 0 )from ‘wp-admin\includes\template.php:684’. <b>$for_post</b> argument is tricky one. If it’s set for false then it forces touch_time to retrieve date for comment instead of post. (see line:700
$post_date = ($for_post) ? $post->post_date : get_comment()->comment_date;). <b><–this causes non-object error</b>
What I’m not sure why check for ‘not equal’ where it should check for equal? This is causing touch_time getting second argument as false when on post-new.php thus calling get_comment() function on post context.
==in touch_time() of piklist submitdiv.php solved the issue for me.
October 30, 2016 at 10:21 pm #7475
- You must be logged in to reply to this topic.