Skip to content
This repository has been archived by the owner on Jun 7, 2022. It is now read-only.

[4.3 RC2]: PHP Fatal error: Uncaught WC_Data_Exception: The admin note icon prop cannot be empty. #4736

Closed
jethrolanda opened this issue Jul 2, 2020 · 4 comments · Fixed by #4745
Assignees

Comments

@jethrolanda
Copy link

jethrolanda commented Jul 2, 2020

Describe the bug
Creating a custom note or even existing WC notes in WC 4.3 RC2 then downgrading from WC 4.3 RC2 to WC 4.2.2 will generate an error:
PHP Fatal error: Uncaught WC_Data_Exception: The admin note icon prop cannot be empty.

Based on my investigation in WC 4.2 table wc_admin_notes it has icon column while in WC 4.3 it was removed and also making set_icon deprecated.

To Reproduce
Steps to reproduce the behavior:

  1. Using WooCommerce Beta Tester plugin, switch to WC 4.3.0-rc.2
  2. Generate a custom Admin Note or just check if it has at least 1 WC Note
  3. Downgrade from WC 4.3 RC2 to WC 4.2.2
  4. It will print:
    PHP Fatal error: Uncaught WC_Data_Exception: The admin note icon prop cannot be empty.

Expected behavior
It should not print a fatal error

Screenshots
image

Wordpress Version 5.4.2
WooCommerce 4.3 RC2

@peterfabian
Copy link
Contributor

cc @timmyc this should probably get a fix before the final release.

@mattsherman
Copy link
Contributor

@timmyc @peterfabian How do we normally handle downgrades when there are DB schema changes?

@timmyc
Copy link
Contributor

timmyc commented Jul 2, 2020

Really great question Matt. I'm thinking the best protection here is to ensure we are deleting all notes in the db on plugin deactivate. That would at least have notes be generated against the current schema.

With regards to this specific scenario, of changing versions with the beta tester plugin, not sure if that would fix the issue. I'd have to look at the beta tester code to see how it performs the updates and downgrades.

@peterfabian
Copy link
Contributor

peterfabian commented Jul 3, 2020

I'd just like to add: now that wc admin is bundled with WC core, we should be careful about not making backwards incompatible changes even in wc admin, so theoretically speaking things like removing methods, changing their signatures (except for adding optional parameters) and removing db columns should not happen.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants