[NPMCLI-173] If page directory with ftl doesn't exist when adding component availability, page definition content is completely removed Created: 08/Mar/18  Updated: 28/Aug/18

Status: Open
Project: Magnolia CLI
Component/s: None
Affects Version/s: 2.2.0, 3.0.0
Fix Version/s: None

Type: Bug Priority: Major
Reporter: Jaroslav Simak Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Bug DoR:
[ ]* Steps to reproduce, expected, and actual results filled
[ ]* Affected version filled
Date of First Response:

 Description   

To reproduce, create page and set it's definition as follows:

title: bucket-list
templateScript: /bucket-list-module/templates/pages/bucket-list.ftl
renderType: freemarker
dialog: bucket-list-module:pages/bucket-list
visible: true
areas:
  main:
    availableComponents:
      activity:
        id: bucket-list-module:components/activity
      image:
        id: mtk:components/image
      linkList:
      google-maps:
        id: google-maps-magnolia:components/google-maps

run the command below and observe error:

jsimak ~/work/magnolia/git/Build/foobar $ mgnl add-availability mtk:components/linkList5 module:page1@main4
info Created new area main4 at the end of /Users/jsimak/work/magnolia/git/Build/bucket-list-module/templates/pages/bucket-list.ftl
info Availability for mtk:components/linkList5 added into /Users/jsimak/work/magnolia/git/Build/foobar/templates/pages/page1.yaml
ERR! ENOENT: no such file or directory, open '/Users/jsimak/work/magnolia/git/Build/bucket-list-module/templates/pages/bucket-list.ftl'
ERR! Error: ENOENT: no such file or directory, open '/Users/jsimak/work/magnolia/git/Build/bucket-list-module/templates/pages/bucket-list.ftl'
ERR! 
ERR! 
ERR! mgnl: 2.2.1-snapshot node: v9.5.0 os: darwin
ERR! please open an issue including this log on https://jira.magnolia-cms.com/browse/NPMCLI


 Comments   
Comment by Christopher Zimmermann [ 28/Aug/18 ]

Can you add a few more details here - i dont totally undestand the problem.

What is the name of that first page yaml file?

The result is that that whole file's contents are removed?

Just because the FTL file of the page templates does not exist? (/bucket-list-module/templates/pages/bucket-list.ftl)

Generated at Mon Feb 12 04:47:14 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.