aggregator
aggregator copied to clipboard
Terms not assigned on cloned post
Terms are not being assigned on a post cloned from the origin site. The data is being carried over but the post displays in the list table with Uncategorized
instead of the proper terms.
Oddly, if you clone a post (using a post cloning plugin we've written - uses wp_set_object_terms()
to assign the same terms to the newly cloned post) the terms/taxonomies will display correctly on the new-new post.
Can you provide the details of the Job you are testing, and the details of all the taxonomy terms used on a post that I can use to reproduce please?
Sure thing Phil:
The Job Pulling 2 post types (posts & media) and every taxonomy type (but not limited to any specific terms) from main site into a single sub-site.
We have 8 taxonomies that should pull over with a post - Sections, Topics, Hashtags, Football Teams, etc. When you publish the post at least one term added in each and go to the portal site, the post is there but the terms are not assigned.
Is that specific enough to be helpful?
I've found a little more information that might help track this down.
Replication steps:
- Create a post on the original site with taxonomies assigned to it and a relationship to portal site setup
- Article on portal site gets created, but when looking in the
term_relationship
table the terms are not assigned to the post - From article list screen, bulk edit post and change to
Published
- term relationships are still not setup - Detach post - terms are now in the
term_relationship
table and displaying in their list columns appropriately
It seems that the post doesn't assign relationships until it's detached or fully pulled into the site using another method (my cloning plugin for example).
Possibly Related: I'm getting the following PHP Warning when creating posts in the master site:
PHP Warning: Invalid argument supplied for foreach() in /srv/www/thesun/wp-content/plugins/aggregator/class-aggregate.php on line 603
The foreach is looping through $tax_terms
within prepare_terms()
- I can open up a new issue for that if you'd prefer
So, terms are added by a cron job after the child post is created on the portal site. Can you check that the cron job is actually running?
You should also be able to force the term import by trying to access the edit post URL for the child post - see https://github.com/Automattic/aggregator/blob/70fbad160419c62f417a85f54c394282cb73e631/class-aggregate.php#L45
OK I did look a little more and I think you're right, looks like my cron job was failing due to a self-signed SSL cert - I will update this ticket if the issue persists after fixing that.
How's this looking, Mike?