Jump to content

Search the Community

Showing results for tags 'addflag'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


AIM


MSN


Website URL


ICQ


Yahoo


Jabber


Skype


Location


Interests

Found 1 result

  1. Hi, Could someone please direct me to how should I go about using `addFlag` on a field in a fieldgroup context? Setting contexts through API is pretty new to me, however I managed to set all other necessary settings through `setFieldContextArray()` function. But the access flags are only applied through `$field->addFlag(128)` (when not inside fieldgroup context) - https://processwire.com/api/ref/field/add-flag/ I have tried (in a module install function): // Create a new fieldgroup $fieldGroup = new Fieldgroup(); $fieldGroup->name = static::NAME; $fieldGroup->add('title'); // trying to set flag to this 'title' // ...Adding other few fresh fields to fieldgroup $fieldGroup->save(); // Works fine. $field_title = wire('fields')->get('title'); $fieldGroup->setFieldContextArray( $field_title->id, array( 'columnWidth' => 50, 'useRoles' => true, 'accessFlags' => [64,128], // Doesn't work. 'addFlag' => 128, // Doesn't work. )); //$fieldGroup->getField('title',true)->addFlag(128)->save(); // Doesn't work with field->save() nor without. $fieldGroup->saveContext(); // Works fine with above setFieldContextArray() settings. // Adding it to a new template and saving. Works fine. $template = new Template(); $template->name = static::NAME; $template->fieldgroups_id = $fieldGroup->get('id'); $template->save(); The API docs seem a bit lacking in this department, very hard to figure out the whole flow ? Any ideas? Thanks in advance!
×
×
  • Create New...