Modify

Opened 2 years ago

Closed 9 months ago

Last modified 9 months ago

#14862 closed defect (fixed)

[Patch needs review] Shift-R is broken

Reported by: hjart Owned by: team
Priority: major Milestone:
Component: Plugin utilsplugin2 Version: latest
Keywords: copy tags selection regression Cc: michael2402

Description

Shift-R (copy tags from previous selection) has been broken for a while (I usually run latest). Now when you create a new object (a node or line) and tag it, then create a second object and try to copy tags from the first object to the second using Shift-R, instead tags from whatever object was selected before the creation of the first object is copied. To correctly tag the second object the first object has to be selected a second time before using Shift-R. This makes the function a lot less useful than it used to be.

Attachments (3)

14862.patch (2.7 KB) - added by GerdP 9 months ago.
14862-v2.patch (2.7 KB) - added by GerdP 9 months ago.
14862-v3.patch (6.9 KB) - added by GerdP 9 months ago.
requires JOSM r14518 or newer

Download all attachments as: .zip

Change History (34)

comment:1 Changed 2 years ago by maxerickson@…

Same or similar issue with newly added tags not getting picked up.

comment:2 Changed 2 years ago by Don-vip

Component: CorePlugin utilsplugin2
Keywords: copy tags selection added; Shift-R removed

comment:3 Changed 2 years ago by michael2402

Ticket #14922 has been marked as a duplicate of this ticket.

comment:4 Changed 2 years ago by stoecker

Ticket #14927 has been marked as a duplicate of this ticket.

comment:5 Changed 2 years ago by MKnight

Bug is between 12040 and 12057 somewhere here: https://josm.openstreetmap.de/changeset?sfp_email=&sfph_mail=&reponame=josm&new=12057%40%2F&old=12040%40%2F&sfp_email=&sfph_mail=

would be nice if there are all versions (not only the published) available at the website in the future ... than its possible for Daus and/or not programmers like me, to find when a bug _exactly_ was born ... and give the Information here for easier and/or faster fixing.

Last edited 2 years ago by MKnight (previous) (diff)

comment:6 Changed 2 years ago by Don-vip

Keywords: regression added

Michael, can you please have a look to see if it's a core regression or if the plugin needs to be updated to latest selection events changes?

comment:7 Changed 2 years ago by kre3d

Started occurring after [12051], which causes the updateEnabledState callback of JosmAction to no longer trigger when the tags of the selection have changed.

comment:8 Changed 2 years ago by AndrewBuck

Ticket #15002 has been marked as a duplicate of this ticket.

comment:9 Changed 2 years ago by Don-vip

Ticket #15339 has been marked as a duplicate of this ticket.

comment:10 Changed 2 years ago by Don-vip

Priority: normalmajor

comment:11 Changed 2 years ago by hjart

Version: testedlatest

comment:12 Changed 23 months ago by Klumbumbus

What's the status of this ticket?

comment:13 Changed 23 months ago by Don-vip

I began to look at it this week but don't understand how it works yet. I hope to fix it this week-end.

comment:14 Changed 23 months ago by kre3d

I've been using a build with [12051] reverted with no problems.

FWIW other actions that depend on the tags of the selected object are also affected by the regression in [12051], e.g. Update Multipolygon. Prior to [12051], selecting a multipolygon then deleting the type=multipolygon tag would disable the Update Multipolygon action. After [12051], the action will remain enabled until the object is reselected.

comment:15 Changed 20 months ago by AlaskaDave

2017-12-19 Please, please, fix this. It has always been a huge timesaver for me. I miss this feature tremendously and I'm sure others do as well.

Thanking you profusely in advance,

AlaskaDave

comment:16 Changed 20 months ago by hjart

Yes, can someone please have a look at this. I'm still trying to use this all the time every day :-(

comment:17 Changed 10 months ago by stephankn

Cc: michael2402 added

Changed 9 months ago by GerdP

Attachment: 14862.patch added

comment:18 Changed 9 months ago by GerdP

Summary: Shift-R is broken[Patch needs review] Shift-R is broken

@team: Problem is that the plugin does not react on a TagsChangedEvent.
Open problems with this patch:

  • I am not 100% sure that I understood what the FireMode.IMMEDIATELY means.
  • It is also not clear to me what should happen when one selects multiple objects and adds or removes a tag.
  • When you undo something this might also fire a TagsChangedEvent and thus the next Shift+R might add unexpected tags.

Don't know how to improve this further.

Changed 9 months ago by GerdP

Attachment: 14862-v2.patch added

comment:19 Changed 9 months ago by GerdP

With v2 the 3rd problem (undo) seems to be solved, now it only reacts when the tags of a selected object are changed.

comment:20 Changed 9 months ago by GerdP

I still try to fix this. I can't remember exactly how it behaved.
What should happen when you

  • first select an object with e.g. highway=service + service=driveway
  • next select another way with tag highway=path + surface=unpaved
  • next press Shift+R. My understanding is that the 2nd way shoud be changed to highway=service + service=driveway + surface=unpaved
  • next select another way with tag highway=unclassfied and press Shift+R again. Should it be changed to

highway=highway=service + service=driveway or
highway=service + service=driveway + surface=unpaved?

comment:21 Changed 9 months ago by GerdP

OK, I've tried with JOSM r12040 and plugin version 33212. It collects the tags of the selected objects, so the result for my example is highway=service + service=driveway + surface=unpaved.
I'll try to get this behaviour back again.

comment:22 Changed 9 months ago by AlaskaDave

It's been so long since it was working that I've forgotten the details but I do remember that the last way you added or modified was somehow remembered. You could then apply those same tags to the next object(s) you selected by typing [Shift]-R. Those tags would remain in the buffer and could be applied to any number of other objects whether new objects or existing ones. Once you change a tag or add a new tag that would update the buffer contents so that afterward the new tag set would be applied to subsequent objects by typing [Shift]-R

Thanks for working on this. I miss the [Shift]-R function every single day.

Changed 9 months ago by GerdP

Attachment: 14862-v3.patch added

requires JOSM r14518 or newer

comment:23 Changed 9 months ago by GerdP

I think with 14862-v3.patch Shift+R works fine again but it requires JOSM r14518 or never.
@team: Do I commit a change to a plugin which requires an untested version of JOSM?
Alternative would be to double the code in the plugin until the new version is tested.

comment:24 Changed 9 months ago by stoecker

Set the required JOSM version in build.xml. The rest is automatic.

comment:25 Changed 9 months ago by GerdP

The wiki is not clear about this. What happens when you execute tested version of JOSM and update the plugins? Will it ignore the newer plugin or will it first update the plugin and next tell the user to update JOSM to an untested version?

Last edited 9 months ago by GerdP (previous) (diff)

comment:26 Changed 9 months ago by stoecker

JOSM will always download the last version with compatible API (downwards) if the entries are correct. Development thus always continues without caring for tested versions.

comment:27 Changed 9 months ago by GerdP

fixed with [o34767:34768]
Shift+R pastes the tags of the last edited or selected object(s). If multiple objects were selected, only the common tags are pasted.

comment:28 Changed 9 months ago by GerdP

Resolution: fixed
Status: newclosed

comment:29 Changed 9 months ago by AlaskaDave

Okay, that all sounds great! Thank you very much, Gerd.

Now, how do I use the patched plugin? I tried updating plugins but JOSM told me they were all up-to-date.

comment:30 in reply to:  29 Changed 9 months ago by GerdP

Replying to AlaskaDave:

Okay, that all sounds great! Thank you very much, Gerd.

Now, how do I use the patched plugin? I tried updating plugins but JOSM told me they were all up-to-date.

That is good. See comment:23

comment:31 Changed 9 months ago by AlaskaDave

OMG! It works again. [Shift]-R WORKS AGAIN!

I'm deliriously happy.

Dave

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.