Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

We've moved the forum!

Please use forum.silverstripe.org for any new questions (announcement).
The forum archive will stick around, but will be read only.

You can also use our Slack channel or StackOverflow to ask for help.
Check out our community overview for more options to contribute.

General Questions /

General questions about getting started with SilverStripe that don't fit in any of the categories above.

Moderators: martimiz, Sean, Ed, biapar, Willr, Ingo, swaiba

Advanced Wokflow - GridField Issues


Go to End


3 Posts   1060 Views

Avatar
Sreek

Community Member, 5 Posts

10 November 2015 at 7:27pm

Edited: 11/11/2015 7:25pm

I am using AdvancedWorkflow on a Gridfield and have included GridField Permission for all members. The problem is when i save data( as a content creator ), the entry gets published on site instead of waiting for the top-level approval, basically Advanced Workflow is not working for Gridfields. I am facing this issue only with GridField Items. Why is it so?

/** Gridfield permission for all members */

    public function canView($member = null) {
	return Permission::check('CMS_ACCESS_CMSMain');
    }


    public function canCreate($member = null) {
        return Permission::check('CMS_ACCESS_CMSMain');
    }

    public function canEdit($member=null) {
        return Permission::check('CMS_ACCESS_CMSMain');
    }

    public function canDelete($member = null) {
        return Permission::check('CMS_ACCESS_CMSMain');
    }

Avatar
camfindlay

Forum Moderator, 267 Posts

13 November 2015 at 4:51pm

Hey Sreek,

This is likely to do with how Pages and DataObjects work together in SilverStripe. Your GridField is likely managing some attached DataObjects via a has_many type data relation. The objects themselves have no sense of versioning unlike pages which set new versions every time save is clicked.

It can be a difficult problem to solve, you could look into applying the Versioned extension on to the DataObjects you are using however you'd need to work out whether a change in an attached DataObject = a Page change too and if the page change is approved how this will publish the known changed versioned dataobject.

As far as I know advanced workflow only applies to data on a page and not data attached to a page (such as dataobjects in gridfields).

Avatar
Sreek

Community Member, 5 Posts

15 November 2015 at 8:54pm

Hey Camfindlay,

Thanks for your reply. It makes sense. I was also thinking in that direction but did not find any documentation supporting them.
Once again thanks for the reply.