Support » Plugin: Advanced Custom Fields: Extended » Allow Custom values not saving

  • Resolved cjjr82

    (@cjjr82)


    Hello,
    I am using ACFE to add a Post Object and allow custom values, however, none of the custom values are being saved on the post. My hope in how this is intended to work is that if the value doesn’t exist it would save the text that was added instead. Also allowing for both Posts to be selected and custom values to be added.
    I don’t want these saved as new posts when they are added, just as text on this one field.

    Can you let me know if this is how this feature should be working?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello @cjjr82,

    Thanks for the feedback! The Post Object field doesn’t allow to save “text”. Values must be a Post ID or an array of Post IDs. If you want to actually save a “word”, you have to enable the “Save custom value as new post” setting. The previous setting “Allow custom values to be added” is feature that let the user enter a text inside the Select.

    If you don’t want to save the input as a new post, but still want to save it into the field, you’ll have to process that input with a custom code. As I said earlier, remember “Post Object” only allow Post ID/array of Post IDs. If you want to save any other type of value, you’ll have to use the “Select” field (which also has the setting to let the user enter a custom input), or create a custom field type for that purpose.

    Hope it helps!

    Regards.

    Thread Starter cjjr82

    (@cjjr82)

    Hi hwk-fr,

    Thanks for the info.
    I guess to me, it doesn’t really make sense to have it as an option on Post Objects if it doesn’t actually work. Maybe the two buttons should be tied together, so you can’t turn one on without the other, since they don’t work separately.
    When you do set “Allow Custom” on a Post Object, it lets you type in custom values, but then doesn’t save them, giving the appearance that the plug-in is broken in some way.

    Just my opinion on it.
    Thanks again!

    Thread Starter cjjr82

    (@cjjr82)

    I didn’t realize that you could set the newly created posts to be Pending, so I went ahead and turned on ‘Allow Custom’ & ‘Save Custom’, set the Post arguments to the same post type limited to in the Post Object and Pending, tested it and it doesn’t create the post.
    Any thoughts on why that wouldn’t be working.

    Thanks again for any help!

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    Thanks for the feedback. The feature is working, but there is a bug if you use the “Allow multiple values” setting. I fixed the issue and merged the “Allow custom value” & “Save custom value” settings, because what you said made sense. I also added some instructions & code examples for developers who want to change the New Post arguments.

    Screenshot: https://i.imgur.com/er54vtB.png

    It will be pushed in the next patch.

    If you want to try the fix & feature, you can copy the following code: https://raw.githubusercontent.com/acf-extended/ACF-Extended/master/includes/fields/field-post-object.php

    And replace everything in the file: acf-extended/includes/fields/field-post-object.php.

    Have a nice day!

    Regards.

    Thread Starter cjjr82

    (@cjjr82)

    Wow, Incredible plugin and insanely helpful support!!

    Thank you so much! The fix worked wonders, and I am off to the races!
    Thank you once again for your time and energy on this plugin!

    Plugin Author Konrad Chmielewski

    (@hwk-fr)

    Hello,

    I’m glad to hear that it’s now working as expected. Thank you for the donation, that’s very kind 🙂

    I need to list all donators in the plugin’s readme “Thank you” section.

    Have a nice day!

    Regards.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘Allow Custom values not saving’ is closed to new replies.