phpcr / phpcr-shell

PHPCR Shell
MIT License
68 stars 19 forks source link

Versionable check is too strict #190

Closed middlebrain closed 6 years ago

middlebrain commented 6 years ago

The check if a node is versionable is too strict (function assertNodeIsVersionable in file /src/PHPCR/Shell/Console/Helper/NodeHelper.php).

A node type without mix:versionable can be derived from a node type with 'mix:versionable'. E.g.

[foo:bar] > nt:base, mix:versionable
[foo:baz] > foo:bar

The current versionable check throws an exception (Node "%s" is not versionable) for nodes of type foo:baz.

dbu commented 6 years ago

indeed. https://github.com/phpcr/phpcr-shell/blob/master/src/PHPCR/Shell/Console/Helper/NodeHelper.php#L35 should instead say if ($mixinType->isNodeType($mixinTypeName)) { to have phpcr handle the type inheritance checking. do you want to send a pull request for this?

dbu commented 6 years ago

fixed in #191