[MGNLUI-4203] JcrNewNodeAdapter#isNew should not return hardcoded true Created: 03/May/17  Updated: 13/Aug/19  Resolved: 13/Aug/19

Status: Closed
Project: Magnolia UI
Component/s: vaadin integration
Affects Version/s: None
Fix Version/s: 5.5.5

Type: Bug Priority: Neutral
Reporter: Federico Grilli Assignee: Federico Grilli
Resolution: Won't Fix Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
relation
is related to CONTEDIT-97 Save / Save & Publish actions don't r... Closed
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
Release notes required:
Yes
Sprint: Basel 94, Basel 95, Basel 96, Basel 97
Story Points: 3

 Description   

JcrNewNodeAdapter#isNew currently returns always true (hardcoded), even after the first successful save. Saving to JCR doesn't necessarily mean that e.g. an app (or subapp) is done with the adapter, therefore, after the first save, subsequent calls to JcrNewNodeAdapter#isNew should return false in order to avoid incorrect or unexpected behaviour in code relying on that method.

To the objection that changing the behaviour of JcrNewNodeAdapter#isNew now may cause unexpected behaviour in code relying on the fact that it always returns true one could reply by saying that we would just make the method honour its semantics as per javadoc at info.magnolia.ui.vaadin.integration.ItemAdapter#isNew

@return true if it's a new Item (not already persisted).

which basically is the same as javax.jcr.Item#isNew

Returns true if this is a new item, meaning that it exists
only in transient storage on the Session and has not yet been saved.

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