social_content_delete_old_nodes() runs through hook_cron() and since query does not have a conditions checking the content type value it is running against multiple content types that are not social media related.

Comments

woombo created an issue. See original summary.

woombo’s picture

Patch fixing the problem.

woombo’s picture

Assigned: woombo » Unassigned
Status: Active » Needs review
pere orga’s picture

Status: Needs review » Active

since query does not have a conditions checking the content type value it is running against multiple content types that are not social media related.

The query does not check the content type but as far as I can see this is safe. If a node id exists in the social_content_history table it means that a node with that ID was imported, and thereby it must be social media content.

Am I missing something?

woombo’s picture

Hey @Pere, sorry for the delay.

Attached two new files:

#1 - social_content_module_phpstorm.png (Please ignore all comments since I've added them just for testing purposes)

  • I have 4 social media accounts associated to the module:
    1. ID = 1 | Twitter
    2. ID = 6 | Instagram
    3. ID = 11 | Facebook
    4. ID = 16 | Instagram
  • Problem is happening when instance id = 11 (Facebook) as you can see in the image.

#2 - social_content_module_sequel.png

  • Running a custom query against DB "joining" node table
  • Results show recent items been added under many different content types that does not related to facebook and specially 2 that are not related to the social content at all: news and staff_profile.
pere orga’s picture

I think the patch is trying to solve the wrong problem.

A node id should not exist in the social_content_history table if it is not of a node imported by Social Content module.

If that is the case, i.e. if you have internal_id values in social_content_history that are from non-imported nodes, then we have a serious bug in Social Content.

I could merge this patch to be extra safe when deleting nodes, but IMO we should fix the bug in the first place.