name_to_id does not work for resources which have names with all numbers #440

Open
mmzeeman opened this Issue Oct 6, 2012 · 7 comments

Projects

None yet

4 participants

@mmzeeman
Member
mmzeeman commented Oct 6, 2012

m_rsc:name_to_id simply returns the passed number as the resource id.

All uses of name_to_id should be checked, because some of those uses could expect this behaviour. If this is the case, m_rsc:rid should be used instead.

@mworrell
Member
mworrell commented Oct 6, 2012

Actually, this is a feature. It is used to distinguish between names and ids that are passed in query args.

Sent from my iPhone

On 6 okt. 2012, at 21:31, Maas-Maarten Zeeman notifications@github.com wrote:

m_rsc:name_to_id simply returns the passed number as the resource id.

All uses of name_to_id should be checked, because some of those uses could expect this behaviour. If this is the case, m_rsc:rid should be used instead.


Reply to this email directly or view it on GitHub.

@mworrell
Member
mworrell commented Oct 6, 2012

But then, you are right that we should untangle the use of m_rsc:rid/2 and m_rsc:name_to_id/2.

@kaos
Member
kaos commented Dec 4, 2012

Assigned to milestone 1.0, as I think this should be done by then, at least.

@ddeboer ddeboer modified the milestone: Release 1.0, Roadmap Jan 12, 2016
@mmzeeman mmzeeman self-assigned this Jun 14, 2016
@mmzeeman
Member

Friendly reminder to myself to put this in master. Bumped into it again...

@mworrell mworrell modified the milestone: 1.0, Roadmap Jun 14, 2016
@ddeboer
Member
ddeboer commented Aug 30, 2016

we should untangle the use of m_rsc:rid/2 and m_rsc:name_to_id/2.

Is this what needs to be done for this issue? What about just ditching rid and keeping name_to_id and name_to_id_check (which crashes intentionally if the resource is not found).

@mworrell
Member
mworrell commented Aug 31, 2016 edited

rid should have the current behavior, "if it looks like an id, assume it is an id"

name_to_id should be strict, if it is not a name, then it can't be mapped.

@ddeboer
Member
ddeboer commented Aug 31, 2016

Okay, so we keep all three: rid, name_to_id and name_to_id_check.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment