Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot Delete Distributed Posts #821

Closed
LucyTurtle opened this issue Nov 22, 2021 · 4 comments · Fixed by #830
Closed

Cannot Delete Distributed Posts #821

LucyTurtle opened this issue Nov 22, 2021 · 4 comments · Fixed by #830
Assignees
Labels
type:bug Something isn't working.
Milestone

Comments

@LucyTurtle
Copy link

Describe the bug
When trying to delete a post that has been distributed to other sites it errors out. I have tried from the "posts" page, and the post editing page. I tried deleting distributed versions first.

Steps to Reproduce
Try to delete a distributed post

Expected behavior
The post would delete

Screenshots
Fatal error: Uncaught TypeError: Argument 1 passed to Distributor\InternalConnections\NetworkSiteConnection::__construct() must be an instance of WP_Site, null given, called in /www/searchsites_680/public/wp-content/plugins/distributor-stable/includes/classes/InternalConnections/NetworkSiteConnection.php on line 640 and defined in /www/searchsites_680/public/wp-content/plugins/distributor-stable/includes/classes/InternalConnections/NetworkSiteConnection.php:53 Stack trace: #0 /www/searchsites_680/public/wp-content/plugins/distributor-stable/includes/classes/InternalConnections/NetworkSiteConnection.php(640): Distributor\InternalConnections\NetworkSiteConnection->__construct(NULL) #1 /www/searchsites_680/public/wp-includes/class-wp-hook.php(303): Distributor\InternalConnections\NetworkSiteConnection::separate_syndicated_on_delete(559) #2 /www/searchsites_680/public/wp-includes/class-wp-hook.php(327): WP_Hook->apply_filters(NULL, Array) #3 /www/searchsites_680/public/wp-includes/plugin.php(470): WP_Hook->do_action(Array) #4 in /www/searchsites_680/public/wp-content/plugins/distributor-stable/includes/classes/InternalConnections/NetworkSiteConnection.php on line 53

@LucyTurtle LucyTurtle added the type:bug Something isn't working. label Nov 22, 2021
@vikrampm1 vikrampm1 moved this to Incoming in Open Source Practice Nov 23, 2021
@jeffpaul
Copy link
Member

@LucyTurtle can you confirm your WordPress and Distributor versions as well as the active theme and any other relevant active plugins? Also confirmation if this is a network set up or separate WordPress installs will help us to replicate your setup / better triage your issue... thanks!

@jeffpaul jeffpaul added the needs:feedback This requires reporter feedback to better understand the request. label Nov 23, 2021
@jeffpaul jeffpaul self-assigned this Nov 23, 2021
@LucyTurtle
Copy link
Author

LucyTurtle commented Nov 23, 2021

Hodwy there! I am on a multi-site setup. Wordpress version 5.8.2, Distributor version 1.6.7.
Theme: GeneratePressVersion: 3.1.0
Plugins:

  • Distributor Version 1.6.7
  • GP Premium Version 2.1.1
  • Imagify Version 1.10
  • Relevanssi 4.14.4

We have been using your plugin for quite a while (since maybe around May?) but I am unsure when this issue started. I don't think until now I had to delete a post on the master site we use for distributing. Thanks for your help!

@github-actions github-actions bot removed the needs:feedback This requires reporter feedback to better understand the request. label Nov 23, 2021
@dkotter dkotter assigned dkotter and unassigned jeffpaul Dec 22, 2021
@dkotter dkotter moved this from Incoming to In Review in Open Source Practice Dec 22, 2021
@dkotter
Copy link
Collaborator

dkotter commented Dec 22, 2021

Thanks for the report @LucyTurtle. I was not able to reproduce the issue myself but looking at the original error message you provided, I do think there's a scenario that could cause problems. Not sure if this is what you might have experienced but right now if you:

  1. Distribute an item to a site
  2. Then at some point delete that site
  3. And then go back and try and delete the original item, you'll end up with the error you see because we are trying to access a site that no longer exists

I would guess this is closer to an edge case situation but still something we should account for. I've opened #830 that adds better checking to ensure we have proper data before proceeding that I believe should solve this.

@jeffpaul jeffpaul added this to the 1.7.0 milestone Dec 22, 2021
@LucyTurtle
Copy link
Author

Hi there! This has got to be it! We are constantly adding and removing websites. So it makes sense!

Repository owner moved this from In Review to Merged in Open Source Practice Dec 23, 2021
@jeffpaul jeffpaul modified the milestones: 1.7.0, 1.6.8 Feb 1, 2022
@vikrampm1 vikrampm1 moved this from Merged to Done/Released in Open Source Practice Jun 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants