Skip to content

Fix a bug on return format - #59

Closed
ixkaito wants to merge 1 commit into
humanmade:masterfrom
ixkaito:patch-1
Closed

Fix a bug on return format#59
ixkaito wants to merge 1 commit into
humanmade:masterfrom
ixkaito:patch-1

Conversation

@ixkaito

@ixkaito ixkaito commented Jun 29, 2019

Copy link
Copy Markdown

Network-media-library ignores the return format on the central media site.

Network-media-library ignores the return format on the central media site.
@johnbillion

Copy link
Copy Markdown
Member

Thanks for the report. NML shouldn't need to make any changes to the return value of this function when operating on the central media site.

What's the exact issue that's occurring? Can you share a code example please?

@ixkaito

ixkaito commented Jun 30, 2019

Copy link
Copy Markdown
Author

If I set "Image Object" as the Return Value for an image field, var_dump( get_field( 'image' ) ); wouldn't return an array but a string of ID (e.g. string '2058' (length=4)) on the central media site, but this returns an array (e.g. array (size=24) 'ID' => int 2058 ...) normally on sites other than the central media site.

@joiglifberg

joiglifberg commented Oct 1, 2019

Copy link
Copy Markdown
Contributor

I can confirm this. The issue is that if a return format other than ID is used for a field fetched with get_field on the central media site, the following conditional won't be true and the return format won't be respected.

https://github.com/humanmade/network-media-library/blob/master/network-media-library.php#L445

@ixkaito

ixkaito commented Sep 6, 2022

Copy link
Copy Markdown
Author

This was not the correct approach, so I'll close it. See #91

@ixkaito ixkaito closed this Sep 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants