Skip to content

Conversation

kasus
Copy link

@kasus kasus commented May 12, 2021

  • Corcel Version: 4.0.1
  • Framework Name & Version: Laravel 7
  • PHP Version: 7.4
  • Database Driver & Version: MySQL

Description:

If term has been deleted from terms table but reference to it left in term_taxonomy table, it throws a PHP error when trying to reach $post->terms attribute.
Since there are no foreign keys in WP tables, additional checking in code is needed.

Steps To Reproduce:

PHPUnit test is included in commit.
Create a Taxonomy with term_id = 0 and attach to the Post, try to get $post->terms attribute.

@kasus kasus force-pushed the handle_corrupted_terms branch from 1c953d6 to ba54c55 Compare May 12, 2021 11:43
@kasus kasus force-pushed the handle_corrupted_terms branch 2 times, most recently from a1663c7 to 674bf6e Compare May 12, 2021 12:34
@jgrossi
Copy link
Member

jgrossi commented Sep 30, 2021

hey @kasus all good to me. can you just fix this conflict with the composer.lock file please? thanks

@kasus kasus force-pushed the handle_corrupted_terms branch from 674bf6e to 9dd2d38 Compare October 24, 2021 17:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants