Closed Bug 1374251 Opened 4 years ago Closed 4 years ago

Fennec Bookmark Management: Name of folder not saved when parent folder is changed as well

Categories

(Firefox for Android Graveyard :: General, defect)

56 Branch
ARM
Android
defect
Not set
normal

Tracking

(firefox56 verified)

VERIFIED FIXED
Firefox 56
Tracking Status
firefox56 --- verified

People

(Reporter: sflorean, Assigned: jwu)

References

Details

Attachments

(1 file)

Environment: 
Device: Huawei MediaPad M2 (Android 5.1.1);
Build: Nightly 56.0a1 (2017-06-18);
Prerequisites: Add 2 folders A and B.

Steps to reproduce:
1. Tap on Folder B -> Edit -> Change name to "Travel" -> Change Parent Folder with "A" folder. 
2.Tap on "Save".

Expected result:
The "Travel" folder is moved into folder "A" edited as user wanted.

Actual result:
The "B" folder is moved into "A" and Bookmarks panel is displayed.
When user selects "Parent folder" the previous action (Change name to "Travel") is not remembered by Firefox. 

Notes:
Check the video: 
https://drive.google.com/file/d/0B0Rtl9OVJNMCd2ItMlZOa1ROVVU/view?usp=sharing
Summary: Fennec Bookmark Management: Name of folder not saved → Fennec Bookmark Management: Name of folder not saved when parent folder is changed as well
Flags: needinfo?(topwu.tw)
Assignee: nobody → topwu.tw
Flags: needinfo?(topwu.tw)
Comment on attachment 8882336 [details]
Bug 1374251 - Save current title into data model before navigating to SelectFolderFragment.

https://reviewboard.mozilla.org/r/153414/#review158976

OK!

::: mobile/android/base/java/org/mozilla/gecko/bookmarks/BookmarkEditFragment.java:174
(Diff revision 1)
>                      return;
>                  }
>  
> +                // When coming back from SelectFolderFragment, we update view with data stored in `bookmark`,
> +                // so before navigating, we have to save current title from nameText into `bookmark`.
> +                bookmark.title = nameText.getText().toString();

Can getText ever be `null`?  What about nameText (I'm hoping no!). I'm also assuming UI prevents empty titles? If it doesn't, what happens here?
Attachment #8882336 - Flags: review?(gkruglov) → review+
Comment on attachment 8882336 [details]
Bug 1374251 - Save current title into data model before navigating to SelectFolderFragment.

https://reviewboard.mozilla.org/r/153414/#review158976

> Can getText ever be `null`?  What about nameText (I'm hoping no!). I'm also assuming UI prevents empty titles? If it doesn't, what happens here?

`getText()` doesn't return `null` but it could return empty string. 

To prevent empty title being saved, we disable the SAVE menu button when nameText contains empty string.
Keywords: checkin-needed
Pushed by cbook@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/59288c1efead
Save current title into data model before navigating to SelectFolderFragment. r=Grisha
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/59288c1efead
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 56
Verified as fixed on build 56.0a1 (2017-07-25).
Device: Huawei MediaPad M2 (Android 5.1.1).
Status: RESOLVED → VERIFIED
Product: Firefox for Android → Firefox for Android Graveyard
You need to log in before you can comment on or make changes to this bug.