I’ve checked against four different MODX 3.0.1-pl sites and all of them fail to save new versions [via VersionX] when Chunks or Snippets are saved.
Resource versions are saved OK.
When saving a Chunk or Snippet - one or more of the following errors are logged:
[2022-07-01 20:15:05] (ERROR @ /home/xxyyzz/core/components/versionx/model/versionx.class.php : 318) PHP warning: Object of class MODX\Revolution\mysql\modSnippet could not be converted to int
[2022-07-01 20:15:21] (ERROR @ /home/xxyyzz/core/components/versionx/model/versionx.class.php : 279) PHP warning: Object of class MODX\Revolution\mysql\modChunk could not be converted to int
[2022-07-01 20:15:21] (ERROR @ /home/xxyyzz/core/components/versionx/elements/plugins/versionx.plugin.php : 117) undefined error
Yeah, that’s the fix that’s needed across all element types, though as for now the modmore policy is to keep extras both 2.x and 3.x compatible from the same codebase (if at all possible, MoreGallery has been… interesting), we usually it like this:
if ($chunk instanceof \MODX\Revolution\modChunk || $chunk instance of modChunk) {
I wish I’d thought of that. I’ve been removing instanceof calls from my extras, on the assumption that MODX will return null if it can’t get the requested object.
That also works. Technically the odds of any getObject returning an object that is not the type you ask for is pretty much impossible, so they’d be equivalent in any but super weird edge cases that don’t happen unless you specifically make them happen to prove the point.