Problem/Motivation
In some cases export contains references to a null objects, e.g. when referring to a parent of a zero-level taxonomy term.
Later, when import occurs, this results in a "Trying to access array offset on value of type null" warning, which generally passes silently except for some specific cases such as test env setup for PHPUnit.
Steps to reproduce
Create and export taxonomy term, try importing it on another env(or after deleting, so that import actually works).
Proposed resolution
Check contents of the $decoded['_embedded'] items before using them.
Comments
Comment #2
temoor commentedComment #3
temoor commentedRerolled for 2.0.x version.
While yml export of 2.0.x isn't affected, hal+json from 8.x-1.x is still supported and can cause the same issue.
Comment #4
mlncn commentedVery nice, thank you! A few fewer notices in the log.
Comment #7
andypostI find it ready but probably missing test
Comment #8
berdirYes, haven't seen this appearing in tests, I think we have term test too? ^
Checking the input doesn't hurt, but I think I'd prefer to not export NULL dependencies in the first place.
Comment #10
berdirA bit pointless now I feel, per #3 this only affects deprecated hal+json import, and I hope nobody is still using that at this point.