Uploaded image for project: '[Read Only] - Hippo Essentials'
  1. [Read Only] - Hippo Essentials
  2. ESSENTIALS-515

Selections plugin fails with NullPointerException and uses deprecated 'valuelist.options'

    XMLWordPrintable

Details

    • Bug
    • Status: Closed
    • High
    • Resolution: Fixed
    • 1.02.05
    • 1.02.07
    • None
    • None
    • 7.10 compliance sprint 1

    Description

      This issue blocks the upgrade of the Training material to Hippo version 7.9.5. The issue does not occur in 7.9.3.

      Hippo version 7.9.5 selectionplugins-addon-cms uses selections plugin 2.08.02 as a parent. In 2.08.02 HIPPLUG-908 is solved. For multi select fields cluster.options is used instead of valuelist.options.

      Essentials 1.02.05 still uses the old model and generated a cluster.options.

      Reproduction path:
      Follow the first two exercises of the training material, as described in https://docs.google.com/a/1hippo.com/document/d/1uR4IRtMtKYWeOjwoP6nxVOC53Z9mSmYlRcKnJPJYIEg/edit#

      2.1 Create the document type
      Return to the Document type editor and add a new document type to the myhippoproject namespace. Call it product and leave the selection for super type as it is (basedocument). Click Next, select the 2 Column layout and click finish.

      Add the following fields to it. Please make sure that you use the path property and types EXACTLY as specified! You will get some prepared demo data later on, so the property names and types must match.

      Come up with captions yourself. Some of the field types can be found under the "Compound Field" accordion tab.

      title - String
      summary - Text
      description - Rich Text Editor (under Compound Fields)

      Click Done and Type actions/Commit.

      Now we are ready to add some content.

      Create a folder named "Products" in the myhippoproject site base folder.

      Create a new document of the type product in it to see the new document type at work.

      2.2 Add a dropdown field using the Selections feature
      Go to /essentials and install the "Selections" feature. Rebuild and restart.

      The Selections forge plugin is now added to the project. In the CMS, add a new folder in the myhippoproject folder. Name it configuration and add a new document in it of the type Value list. Name it categories. Add three items in it with the following keys:

      food
      transport
      solar

      Make up the labels yourself.

      Before we can use this list to populate a dropdown field, Essentials needs to rebuild the project once more. Check in /essentials that this is indeed the case. So, rebuild and restart again. (This step does not make much sense yet, and will be moved to a later phase in a newer version of Essentials. See: https://issues.onehippo.com/browse/ESSENTIALS-461).

      After this rebuild we can use the configuration options of the feature. Go to the Selections feature in /essentials and click the Configure button. Then do as follows:

      Choose the product document type
      Give as field name Categories
      Choose selection type multiple
      Choose the Value list you just created
      Click the Add new selection field button

      Go back to the Document type editor in the CMS and edit the product document type.

      Expected:
      You see that Essentials added the multivalue field in the left column. Move it to the right column. Click Done and Type actions/Commit.

      Result:
      NullPointerException. The same exception is showed if you open the document.

      Workarounds tried:
      Executed the Groovy script from http://selection.forge.onehippo.org/configuration/dynamicmultiselect.html
      Looged out, restarted, but nevertheless the same error is shown and the categories field in Product document is not editable.

      Log:

      [DynamicMultiSelectPlugin.<init>:154] The configuration node name 'valuelist.options' is deprecated. Rename it to 'cluster.options'.
      path=/hippo:namespaces/myhippoproject/product/editor:templates/default/categories/cluster.options

      Java.lang.NullPointerException: null
      Failed to instantiate plugin class 'org.onehippo.forge.selection.frontend.plugin.DynamicMultiSelectPlugin' for wicket id 'services.784.preview' in plugin 'home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.categories-preview.cluster..plugin.home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.plugin.categories' (plugin.class = "org.onehippo.forge.selection.frontend.plugin.DynamicMultiSelectPlugin" field = "categories" valuelist.provider = "service.valuelist.default" wicket.id = "services.784.preview" caption = "Categories" valuelist.options = "[source = "/content/documents/myhippoproject/configuration/categories" engine = "home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.reference.engine" frontend:properties = "[mode]" frontend:references = "[wicket.model, model.compareTo, engine, validator.id]" frontend:services = "[wicket.id, validator.id]" mode = "edit" model.compareTo = "home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.reference.model.compareTo" validator.id = "home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.service.validator.id" wicket.id = "home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.service.wicket.id" wicket.model = "home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.reference.wicket.model"]" engine = "home.cluster.cms-static.plugin.servicesLoader.cluster.cms-services.plugin.defaultEditorFactory.cluster.cms-editor.plugin.editorPlugin.cluster.default.plugin.preview.cluster.default.reference.engine" frontend:properties = "[mode]" frontend:references = "[wicket.model, model.compareTo, engine, validator.id]" frontend:services = "[wicket.id, validator.id]" mode = "edit" model.compareTo = "home.cluster.cms-

      Attachments

        Issue Links

          Activity

            People

              tjeger Tobias Jeger
              mhodenpijl Martijn Hodenpijl (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: