Modify

Opened 2 years ago

#23199 new defect

Using placeholders and selector classes breaks validator

Reported by: VAis4mappers Owned by: team
Priority: normal Milestone:
Component: Core validator Version: latest
Keywords: Cc:

Description

I've come across this problem in using the validator. This works in removing the "phone" tag:

*["name"] {
  set name;
}

*["phone"] {
  throwWarning: "{0.key} not in a standard format";
  fixRemove: tr("{0}", "{0.key}");
}
/* warns "phone not in a standard format" */

While this does not:

*["name"] {
  set name;
}

*["phone"].name {
  throwWarning: "{0.key} not in a standard format";
  fixRemove: tr("{0}", "{0.key}");
}
/* warns "phone not in a standard format" */

The only difference is that I've added the "name" class to the selector in the second example. Both examples throw the warning properly, but only the first successfully removes the "phone" tag. Using fixRemove: "{0.key}"; on line 7 also works in the first example but not the second.

Note that these examples are silly and useless, but have come up in more complex, useful rules I've been trying to make, and I think this is the (or one of the) root causes. Another would be a function to get list slices but that is a separate issue :) Is this expected behavior? I'm on version 18822. Yes, I know I could write rules such that I don't need to use classes but would prefer not to. Thanks!

Attachments (0)

Change History (0)

Modify Ticket

Change Properties
Set your email in Preferences
Action
as new The owner will remain team.
as The resolution will be set. Next status will be 'closed'.
to The owner will be changed from team to the specified user.
Next status will be 'needinfo'. The owner will be changed from team to VAis4mappers.
as duplicate The resolution will be set to duplicate. Next status will be 'closed'. The specified ticket will be cross-referenced with this ticket.
The owner will be changed from team to anonymous. Next status will be 'assigned'.

Add Comment


E-mail address and name can be saved in the Preferences .
 
Note: See TracTickets for help on using tickets.