pods-framework / pods

The Pods Framework is a Content Development Framework for WordPress - It lets you create and extend content types that can be used for any project. Add fields of various types we've built in, or add your own with custom inputs, you have total control.
https://pods.io/
GNU General Public License v2.0
1.07k stars 264 forks source link

[BUG] default value of hidden field author ? saving as no value #2814

Closed lucianahanan closed 2 years ago

lucianahanan commented 9 years ago

Defined author field as hidden from ui, with a default value ( 2 ). But when saving from form, the input hidden of author doesn't have any vallue, and when the form is saved, the field remains empty in database.

sc0ttkclark commented 9 years ago

Can you post the code you were using to do this? What content type? Custom Post Type or Advanced Content Type?

lucianahanan commented 9 years ago

create new ACT, add some fields. define hide author from ui, and author default value = 2 put [form] shortcode in a normal page. see form source, there is an input hidden for author, but it has no value="2" as expected. fill form and send author field remains blank in database

Shelob9 commented 9 years ago

@YammYcoding What is your shortcode?

lucianahanan commented 9 years ago

[pods name="test" form="1"]

Created a new ACT, added a foo text field and saved. Installed 2.5.2 beta 1 today. Still same behavior.

lucianahanan commented 9 years ago

WITH USER LOGGED IN Test: include a test pod, with author showing in form, with default value ( user id )

new record saved, author correct.

Test: include a test pod, with author hiding from ui, with default value ( user id )

new record saved, empty value in author. <<<< problem

Test: include a test pod, with author showing in form, with default value = 1

new record saved, author 1 is correct.

Test: include a test pod, with author hiding from ui, with default value = 1

new record saved, author 1 is correct.

WITH USER NOT LOGGED IN Test: include a test pod, with author showing in form

No record saved. Error: Access denied, please refresh and try again. <<<< problem

Test: include a test pod, with author hiding from ui

No record saved. Error: Access denied, please refresh and try again. <<<< problem

sc0ttkclark commented 9 years ago

Can you clarify which option you're using to hide the field?

lucianahanan commented 9 years ago

[x] Advanced > Hide field from ui

Shelob9 commented 9 years ago

Possibly could be the same bug as in #2610 or similar.

lucianahanan commented 9 years ago

this 2610 seems something else, mine is specific about the author hide from ui things =)

the access denied otherwise, seems to be related to the restriction on guest users that cannot post to wp normally.