Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

magic tag {@type} returns pod name when a field of name = 'type' does exists. #689

Closed
ghost opened this issue Oct 26, 2012 · 3 comments
Closed
Assignees
Milestone

Comments

@ghost
Copy link

ghost commented Oct 26, 2012

In an Advanced Content Type pod you are allowed to create a field with name = 'type'. You can access this field with PHP: $pods->field('type'). However, the magic code {@type} gives the pod name. As process_magic_tags() has this code: if ( 'type' == $field_name ) $value = $this->pod; - this seems to be by design. In this case should you allow the creation of a field with name = 'type' when it cannot be accessed with a magic tag.

@ghost ghost assigned pglewis and sc0ttkclark Oct 27, 2012
@pglewis
Copy link
Contributor

pglewis commented Oct 27, 2012

It's quite possible that 'type' is meant to be reserved, Scott will know the answer.

@sc0ttkclark
Copy link
Member

{@type} is indeed a vestige from Pods 1.x days. I'm not entirely sure if it's ever even been used by anyone... I'm thinking we should deprecate it for 2.x and have it only evaluate as the pod name when using get_field or deprecated template functions.

@ghost
Copy link
Author

ghost commented Oct 31, 2012

My feelings is that the behavior of $pods->field('type') (which returns the value of the field named 'type') and {@type} should be identical so I vote for deprecation.


From: Scott Kingsley Clark notifications@github.com
To: pods-framework/pods pods@noreply.github.com
Cc: magenta-cuda magenta.cuda@yahoo.com
Sent: Wednesday, October 31, 2012 6:27 AM
Subject: Re: [pods] magic tag {@type} returns pod name when a field of name = 'type' does exists. (#689)

{@type} is indeed a vestige from Pods 1.x days. I'm not entirely sure if it's ever even been used by anyone... I'm thinking we should deprecate it for 2.x and have it only evaluate as the pod name when using get_field or deprecated template functions.

Reply to this email directly or view it on GitHub.

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

No branches or pull requests

2 participants