Uploaded image for project: 'Hippo CMS'
  1. Hippo CMS
  2. CMS-9935

ResourceBundleModel does not support default value in case a key is not present

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Normal
    • Resolution: Fixed
    • None
    • 4.0.0
    • None
    • None

    Description

      Currently, org.hippoecm.addon.workflow.WorkflowManagerPluginTest#workflowCategoryIsUsedAsMenu fails. This is caused by "plugin-test" not being a present key in a ResourceBundleModel. The ResourceBundleModel replaced StringResourceModel which had support for 'default value' in case the key cannot be found.

      My suggestion is :

      1) Add a constructor for ResourceBundleModel with extra argument 'String defaultValue' and return this defaultValue (even if null) in case the key is missing
      2) when the key is missing and the constructor without 'defaultValue' is used, return "?" + key + "?"

      If the above is done, in MenuButton#MenuButton

       
      new ResourceBundleModel("hippo:workflows", name)
      

      with

       
      new ResourceBundleModel("hippo:workflows", name, name)
      

      (where last argument is the defaultValue)
      Apart from this, we need to check other usages of ResourceBundleModel : They replaced the StringResourceModel. Should they also use the constructor with defaultValue instead?

      Attachments

        Activity

          People

            adouma Ate Douma (Inactive)
            aschrijvers Ard Schrijvers
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: