Change WordPress user roles and capabilities Forums Bug Reports Conflict with Oasis Workflow?

Viewing 15 posts - 1 through 15 (of 19 total)
  • Author
    Posts
  • #7633
    edering
    Participant

    Hi. On iu13.org, we use Oasis Workflow to manage content changes for the Users of the Role called Program Editor. Part of Oasis’ process is to make a copy of a page and call it “copy of PAGE NAME” and put it in Draft. We started noticing some issues with the Content and the Permalink changing to content from a completely different Page (seems to be the OLD published page on the site) and a different Permalink (adding a “-2” but also using the oldest page on the site). After working a lot with Oasis Workflow, we determined it was not directly related to them. You still have an Admin user on this site (user is “ure” and uses your support email).

    1. Create a new page called “Pat-Erik SBU004 Test” – https://www.iu13.org/pat-erik-sbu004-test/ – as SBU004 page as IU13 Super Admin. I entered this specific content seen here: https://www.screencast.com/t/wYaKZXdt I also set the “Analytics Group Name” to “SBU004”. https://www.screencast.com/t/kA42TaVdei Note: we don’t think this matters, but just in case. Clicked Publish. https://www.screencast.com/t/Q2tcGAW3MXiH Then I Logged out.
    2. Logged back in as new User called “ppontz – Program Editor – SBU0004” which is set to a Role of Program Editor and only access to Pages set SBU004 for the Analytics Group Name (you helped me with that in the past). https://www.screencast.com/t/laxTq1gL
    3. Went to Pages, and clicked on the page called Pat-Erik SBU004 Test by hovering and choosing Edit. https://www.screencast.com/t/ebaaCWgG
    4. Page opened, and the Oasis Workflow popup appeared. We are to click Make Revision, which I clicked. https://www.screencast.com/t/E6Txoa8WZo
    5. New Page was created correctly (part of Oasis Workflow) and Opened correctly as “Copy of – Pat-Erik SBU004” with correct content. https://www.screencast.com/t/iASlbVh3xH
    6. Edited by adding some text to the end, then clicked Save Draft button. All fine at that point. I see the correct Page Name and the edited content. https://www.screencast.com/t/qKyasqu8gIU4
    7. But I clicked Save Daft again, and the “Replacement Title” and the Content changed. https://www.screencast.com/t/q3JvRbNwb NOTE: This sometimes happens on first Save Draft attempted, other times it takes 2-3 attempts. ALSO, note that the Permalink is correct still. That changes on the next step.
    8. Then, make no changes, but click Save Draft again, and the permalink is changed. It is grabbing the URL of where the content is coming from and adding a “-2”. https://www.screencast.com/t/RbF5FGpUCS

    What is interesting (maybe a coincidence?) is that the page that it grabbed the content from – https://www.iu13.org/educators/instruction/instructional-technology/pla/personalized-learning-academy-opps/pla-phase-2/ – is the published page with the oldest “date” when I sort all SBU004 pages by the date column. (Some internal redirects are older, but it’s the oldest page.) Maybe that is helpful. Any ideas of what the issue could be?

    #7638
    Vladimir
    Keymaster

    Thanks for the detailed description. I will try to reproduce and investigate this.

    #7639
    Vladimir
    Keymaster

    I reproduced and investigate now some of the described problems with content versioning/revisions.

    The conflict takes place between code which restricts edit access by pages ID list and Advanced Custom Fields which shows the latest content for the ‘draft’ page, when the edit restrictions were switched off, and shows some older cached content when edit restrictions are active.

    I did not find solution to the moment and continue working on this problem.

    #7640
    edering
    Participant

    Thanks!

    #7642
    Vladimir
    Keymaster

    I found that “Advance Custom Fields” plugin stores its custom fields data as the custom post type ‘acf-field’. This may be a problem, why some of revisioned values of such fields were not available when URE applied edit restrictions by the list of the post ID, as ‘acf-field’ custom post type was not included into the list of records available for the current user.

    I added ‘acf-field’ custom post type to the arguments list of the code at your functions.php file:

    
    $posts = get_posts(array(
    	'numberposts'	=> -1,
    	'post_type'		=> array('tribe_events','page','revision','acf-field'),
    	'post_status'   => 'any',
    	'meta_query'	=> array(
    		'relation'		=> 'OR',
    		array(
    			'key'	 	=> 'analytics_group_name',
    			'value'	  	=> $ag,
    			'compare' 	=> 'IN',
    			),		
    		),
    	));
    

    As you use revisions, I added revision post type too and replaced post status to ‘any’ (revision has ‘inherit’ post status’).

    Restricted user sees the latest content now at my test site. Make a new test at your own.

    #7643
    edering
    Participant

    Thanks. Pat (my client) just tried it and she said it still is not working. I then cleared the Kinsta cache, and had her try it again in an incognito window. She said it still did not work for her. Here is what she said: “Unfortunately, no luck. I created a new page then went in as Program Editor, and the content replaced while I was editing/saving.” Can you try to replicate what she tried using her same accounts? Remember, a key is using the same SBU (like SBU004) for the Page you revise and the Program Editors access rights (she has a test Program Editor SBUOO4 user as noted in my original post above).

    #7644
    edering
    Participant

    Hi. Any luck with this?

    #7645
    Vladimir
    Keymaster

    Hi,

    Unfortunately, I did not find a solution for today. I will make the few tries more though.

    #7647
    edering
    Participant

    Hi. Pat, my client, wanted me to check on this. Any luck? Thanks

    #7648
    Vladimir
    Keymaster

    Hi,

    Thank you for the patience. Give me few days more. I will try to get the final conclusion on the issue to the next Monday.

    #7649
    Vladimir
    Keymaster

    Hi,

    Test the updated version. My test at http://www.iu13.org was finished successfully.

    As a result of my investigations, I replaced code extracting pages list with SBU004 analytics group from the WP API to the direct SQL command, which will not exclude from the result the pages with post_status related to Oasis Workflow plugin, etc.

    #7650
    edering
    Participant

    It works now! Thanks! But one little think Pat noticed and it happened also on your test. The Author of your Revision changed to “Alanna Woody” and so did the Author of Pat’s Test (she was logged in as her. See https://www.screencast.com/t/4bImuhdV Any idea why?

    #7652
    Vladimir
    Keymaster

    User “Alana Woody” is not restricted by URE as she is not included into SBU004 analytics group. I don’t think that URE is related here.

    Btw., can you provide step by step scenario in order to repeat this?

    #7654
    edering
    Participant

    Hi. The sample page you set up already was showing as Alanna Woody being the author. When Pat created her own test page, it also showed her as the author. Alanna Woody had nothing to do with either page, and we don’t know what was done in creating other than that the pages were created as SBU004. She is one of our admin users (not “super admin”, but the next lower level) but was not active on the account. I’m not really sure what to describe as all that was done was creating a new page. When you (or Pat) create a page as a User, that user should be the Author. Why is it picking Alanna Woody? See https://www.screencast.com/t/4bImuhdV again and you will see your original was set to you as the author, but the Copy Of version was Alanna. So was Pat’s.

    #7720
    edering
    Participant

    Hi. We are seeing an issue with above. All WP Users regardless of the setting in their User Profile for Analytics Group Name see only pages associated to SBU004. https://www.screencast.com/t/llCMHECNsdz Functions line 909 should be dynamic like b.meta_value IN ({$ag}) ) AND not hardcoded with a specific SBU like you had b.meta_value IN (‘SBU004’) ) AND. Right now, all of our WP Users are seeing SBU004 Pages even though our Users have query that allows them to only see Pages set to one Analytics Group Name. Can you please help? You can test by using User called “kaitlyn_keller” who is SBU002. Any pages in https://www.iu13.org/community/community-education/ should show for that user and only them. Thanks

Viewing 15 posts - 1 through 15 (of 19 total)
  • You must be logged in to reply to this topic.