johnbillion / extended-cpts

A library which provides extended functionality to WordPress custom post types and taxonomies.
GNU General Public License v2.0
979 stars 96 forks source link

P2P admin column showing connection when none exists #48

Closed JiveDig closed 7 years ago

JiveDig commented 8 years ago

I'm using 3.0.1 of Extended CPTs.

I have 2 CPT's with a one-to-many connection via: p2p_register_connection_type( array( 'name' => 'programs_to_steps', 'from' => 'wampum_program', 'to' => 'wampum_step', 'cardinality' => 'one-to-many', 'can_create_post' => false, 'sortable' => 'any', 'admin_box' => array( 'show' => 'any', 'context' => 'side', ), 'admin_column' => true, ) );

When viewing the 'wampum_step' CPT archive in admin, the connected post results are off. See screenshot.

screen_shot_2016-06-13_at_2_58_45_pm

The correct column is on the right, but I would like to show these columns via Extended CPTs rather than default p2p.

JiveDig commented 8 years ago
screen shot 2016-06-13 at 3 09 27 pm
JiveDig commented 8 years ago

Just created a new post (Step), and connected it to a different Program. The list is showing the same (wrong) connection still. Something is weird. I'm starting to think it's on my end now.

JiveDig commented 8 years ago

FWIW, it's working the other way.. .when i view Programs admin archive it shows everything correctly. But the reverse, on Steps archive is the issue.

johnbillion commented 8 years ago

Thanks for the ticket.

There's a good chance there's a bug here because the P2P functionality in ExtCPTs isn't very well tested. I had a use for it once, a long time ago, and it's not gotten much love since.

If you can pinpoint where the issue is that'd be a great help!

JiveDig commented 8 years ago

Thanks for the reply John. I really love these classes FWIW, extremely powerful. Thanks for sticking with them ;)

I'm not sure how else to debug, unfortunately. It works on one 'side' of the connection, but not the other. I may have to recreate on a test install and see if the issue still exists. Create 2 CPT's, register a p2p connection between them, then use admin_cols to display the connection for both CPTs. That's all that I appear to have done.

edwinsiebel commented 8 years ago

Hope my fix will solve your problem. Could you try, so we have another testcase?

JiveDig commented 8 years ago

Will test tomorrow, thanks!

edwinsiebel commented 7 years ago

@JiveDig, have you tried the fix, and does it work in your case?

JiveDig commented 7 years ago

Ah sorry, I rebuilt the plugin I hit the big in without the need for P2P so I haven't tested. I still love P2P though so I'd love to know this works. Not sure when I'll find the time to test, but I'd like to.

johnbillion commented 7 years ago

Closing in favour of #53.