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

.permalink traversal for related taxonomies don't work #2779

Closed
PodsBot opened this issue Mar 5, 2015 · 13 comments · Fixed by #2780
Closed

.permalink traversal for related taxonomies don't work #2779

PodsBot opened this issue Mar 5, 2015 · 13 comments · Fixed by #2780
Assignees
Milestone

Comments

@PodsBot
Copy link
Collaborator

PodsBot commented Mar 5, 2015

.permalink traversal for related taxonomies don't work submitted via Slack by josh

@Shelob9 Shelob9 added Type: Bug Status: Help Wanted We have not prioritized this yet, but you can help make it happen to speed it up Status: Need Research labels Mar 5, 2015
@Shelob9
Copy link
Contributor

Shelob9 commented Mar 5, 2015

L795 (in 2.x) looks like where it should pick up the term link. But it doesn't since the conditional that is wrapped in is based on $params->name which has the full value passed for field.

But I think I'm missing something, since that would apply to all .permalink traversals, which work otherwise.

@Shelob9 Shelob9 added this to the Pods 2.5.3 milestone Mar 5, 2015
@Shelob9
Copy link
Contributor

Shelob9 commented Mar 5, 2015

It could also get picked up on 1472, but that doesn't get hit because the conditional on 1415 correctly is not passed.

@Shelob9 Shelob9 self-assigned this Mar 5, 2015
@Shelob9 Shelob9 added Fixed / Needs Testing and removed Status: Help Wanted We have not prioritized this yet, but you can help make it happen to speed it up Status: Need Research labels Mar 5, 2015
@NikV
Copy link
Contributor

NikV commented Mar 17, 2015

Alright just tested this earlier and confirm it works. Here is how I tested. I created a taxonomy called "tags2". I tested it with echo $pods->display( 'tags2.permalink' ); ($pods being the pods object). The result from this echo was http://local.wordpress.dev/tags2/tag/, which I think would be the proper output for this method. The tags2 taxonomy had only one term assigned to the post.

@Shelob9
Copy link
Contributor

Shelob9 commented Mar 17, 2015

@NikV That's good, but what happens if there are two terms associated with the post? Please report what happens with echo $pods->display( 'tags2.permalink' ); as well as var_dump( echo $pods->field( 'tags2.permalink' ) );

@NikV
Copy link
Contributor

NikV commented Mar 17, 2015

For the echo $pods->display( 'tags2.permalink' );, I only get the first term archive link, not the second one.

@Shelob9
Copy link
Contributor

Shelob9 commented Mar 17, 2015

Sounds like this patch needs more work. What does the var_dump look like?

@NikV
Copy link
Contributor

NikV commented Mar 17, 2015

The var_dump( echo $pods->field( 'tags2.permalink' ) ); outputs this: array(0) { }

@Shelob9
Copy link
Contributor

Shelob9 commented May 13, 2015

close via f615242

@Shelob9 Shelob9 closed this as completed May 13, 2015
@sc0ttkclark sc0ttkclark reopened this May 13, 2015
@sc0ttkclark
Copy link
Member

Commit needs revisit

@pglewis
Copy link
Contributor

pglewis commented Aug 18, 2015

If you do a var_dump() on just field( 'taxname' ):

array(3) {
  [0]=>
  array(10) {
    ["term_id"]=>
    string(1) "8"
    ["name"]=>
    string(6) "Term 1"
    ["slug"]=>
    string(6) "term-1"
    ["term_group"]=>
    string(1) "0"
    ["term_taxonomy_id"]=>
    string(1) "8"
    ["taxonomy"]=>
    string(12) "multitermtax"
    ["description"]=>
    string(0) ""
    ["parent"]=>
    string(1) "0"
    ["count"]=>
    string(1) "1"
    ["pod_item_id"]=>
    string(1) "8"
  }
  [1]=>
  array(10) {
    ...
  }
}

permalink is not included, thus returning an empty array. field('name') or display('name') works as expected.

@pglewis pglewis modified the milestones: Pods 2.5.5, Pods 3.0 Aug 19, 2015
pglewis added a commit that referenced this issue Aug 21, 2015
pglewis added a commit that referenced this issue Aug 21, 2015
@pglewis pglewis assigned sc0ttkclark and unassigned pglewis Aug 21, 2015
sc0ttkclark added a commit that referenced this issue Sep 10, 2015
Issue #2779: `permalink` field traversal has only been working for post types (2.x)
sc0ttkclark added a commit that referenced this issue Sep 10, 2015
Issue #2779: `permalink` field traversal has only been working for post types (3.0)
@sc0ttkclark
Copy link
Member

Merged into 2.x / 3.0, can we close and confirm this issue as fixed? @pglewis @Shelob9

@hotzeplotz
Copy link

for info, this may or may not be related, but .permalink traversal for related ACTs had been working correctly for me on a theme i develop until upgrading to Pods 2.5.5 - but 2.5.5. version broke the .permalink traversal for me, somehow. not sure whether it's a distinct bug, and i couldn't find any issue for the ACT behaviour change, so apologies if i'm creating noise here 😏

'fixed' by getting the entire related ACT via $rel = $pod->field('podname') and then using $rel['permalink'], in the meanwhile.

@pglewis
Copy link
Contributor

pglewis commented Sep 22, 2015

I've opened #3155 for the regression this has caused.

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

Successfully merging a pull request may close this issue.

6 participants