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

Field returns data in form of multiple videos even if "select multiple videos" is set no #10

Closed
roopemerikukka opened this issue May 11, 2016 · 9 comments

Comments

@roopemerikukka
Copy link

roopemerikukka commented May 11, 2016

Hi,

I just updated the plugin to 3.0.0 and I noticed that the field returns array which has array inside it as it would have multiple videos selected even if I have the "select multiple videos" set to no.

So as I have selected the video id before by using $video["vid"] now I get it by using $video[0]["vid"]

Is this normal behaviour of a bug?

I also noticed that when I sync in ACF it creates completely new Field Group instead of syncing and I can't remove the old one.

BTW Thanks for amazing plugin!

@airesvsg
Copy link
Owner

Hi @roopemerikukka,
please export your acf field group and attach here.
I'll test them.
Thanks

@roopemerikukka
Copy link
Author

Hi and sorry for the delayed answer. Here is the field group of our cover video:

{
    "key": "group_56c4864cd019a",
    "title": "Required cover video",
    "fields": [
        {
            "key": "field_56c4865199b43",
            "label": "Video",
            "name": "cover_video",
            "type": "youtubepicker",
            "instructions": "",
            "required": 1,
            "conditional_logic": 0,
            "wrapper": {
                "width": "",
                "class": "",
                "id": ""
            },
            "api_key": "AIzaSyAuHQVhEmD4m2AXL6TvADwZIxZjNogVRF0",
            "multiple": 0,
            "yp_advanced_options": 1,
            "answerOptions": [
                "title",
                "vid",
                "url",
                "thumbs",
                "iframe"
            ],
            "channelId": "",
            "channelType": "",
            "eventType": "",
            "order": "relevance",
            "safeSearch": "none",
            "videoCaption": "any",
            "videoDefinition": "any",
            "videoDimension": "any",
            "videoDuration": "any",
            "videoEmbeddable": "true",
            "videoLicense": "any",
            "videoSyndicated": "any",
            "videoType": "any",
            "videoCategoryId": "",
            "relatedVideoId": "",
            "topicId": "",
            "regionCode": "",
            "relevanceLanguage": "",
            "maxResults": ""
        }
    ],
    "location": [
        [
            {
                "param": "post_type",
                "operator": "==",
                "value": "post"
            },
            {
                "param": "post_taxonomy",
                "operator": "==",
                "value": "fs-journal-post-format:video"
            }
        ]
    ],
    "menu_order": 2,
    "position": "normal",
    "style": "default",
    "label_placement": "top",
    "instruction_placement": "label",
    "hide_on_screen": "",
    "active": 1,
    "description": "",
    "modified": 1460373170
}

@airesvsg
Copy link
Owner

Hi @roopemerikukka,
I'll test soon.
Thanks

@airesvsg airesvsg reopened this May 23, 2016
@roopemerikukka
Copy link
Author

I deleted the whole fieldgroup and recreated it again to see if there was some database cache problems but with no luck. Have you had time to test this?

@airesvsg
Copy link
Owner

airesvsg commented Jun 1, 2016

Hi @roopemerikukka,
what's version of ACF?
Thanks

@roopemerikukka
Copy link
Author

I have ACF version 5.3.3.1 installed. I'll try to update it and check if that fixes the problem.

@roopemerikukka
Copy link
Author

Nope. That didn't fix the issue. I found that this happens because in the file fields/acf-youtubepicker.php the check if ( 'api' === $format ) { on row 456 fails and the else part (rows 486-488) creates the array in format of multiple videos. Didn't have time to find where the $format comes from but maybe you can answer? :)

@sarukuku
Copy link

Any updates on this?

@roopemerikukka
Copy link
Author

Superb 👍

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

No branches or pull requests

3 participants