salsadigitalauorg / merlin-framework

Merlin - migration framework
GNU General Public License v3.0
16 stars 3 forks source link

Processors do not execute on menu configuration data generation #64

Closed fubarhouse closed 5 years ago

fubarhouse commented 5 years ago

Describe the bug In adding processors to menu items, the runs complete successfully without actually executing any configured processors. This is shown to be the case in #36 and appears to be related.

Sample configuration

---
domain: https://www.chiefscientist.gov.au
urls:
  - /

entity_type: menus

mappings:

  - field: main_menu
    name: main-menu
    type: menu_link
    selector: '//*[@id="menu-main-menu-1"]/li'
    processors:
      - processor: replace
        pattern: (http:\/\/www.chiefscientist.gov.au\/)
        replace: '/'
      - processor: replace
        pattern: (https:\/\/www.chiefscientist.gov.au\/)
        replace: '/'
      - processor: replace
        pattern: (\/$)
        replace: ''
    options:
      text: './a'
      link: './a/@href'
    children:
      - type: menu_link
        selector: './ul/li'
        processors:
          - processor: replace
            pattern: (http:\/\/www.chiefscientist.gov.au\/)
            replace: '/'
          - processor: replace
            pattern: (https:\/\/www.chiefscientist.gov.au\/)
            replace: '/'
          - processor: replace
            pattern: (\/$)
            replace: ''
        options:
          text: './a'
          link: './a/@href'

Expected behavior In the example above, menu links should have their link path filtered: the domain and trailing slash should be absent.

Screenshots n/a

Additional context n/a

steveworley commented 5 years ago

Added sub-component processing to menu link.