• Resolved johnbuol

    (@johnbuol)


    WP: 6.3.1, Pods: 3.0.4
    Working on a Pods-based WP site with the Administrator account having all capabilities, I was suddenly unable to modify or publish new Posts. All CPT-based Pods showed the error “Sorry, you are not allowed to edit this item.”

    I started debugging by deactivating all plugins and themes, clear all caches (Pods cache, WP, and Nginx), reset server, reset computer, and re-checked the Administrator role as having all permissions/capabilities via Pods Roles&Capabilities. The debug log (define( ‘WP_DEBUG’, true )) does not reveal any errors. It seems my WP install is dutifully restricting content creation and access despite a user having full Capabilities and I don’t understand why.

    I created a new WP local site and re-created the issue only after importing the Pods export json data from the original site. So, the issue seems to do with some configuration with the Pods CPTs

    I deleted the CPT Pods and recreated them from scratch on the new test dev site, renewing functionality with the still-existing database data there.

    Doing the same on the original site seemed to fix the Pods CPT access problem, but did not. Editing an existing Pods redirects to the Posts menu and the editing is not saved.

    Trying to add a new Pods CPT now throws an error:
    “Deprecated: Return type of Pods\API\Whatsit\Value_Field::offsetExists($offset) should either be compatible with ArrayAccess::offsetExists(mixed $offset): bool, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in \wp-content\plugins\pods\src\Pods\API\Whatsit\Value_Field.php on line 70”

    Also, on the original site my Administrator account still cannot edit Posts authored by that account even though Pods Roles&Capabilities still shows having all available Capabilities. That account can’t change the Category and if the content is changed or added, not even the new Draft is saved. Instead, the message at the top reads:
    “The backup of this post in your browser is different from the version below. Restore the backup
    This will replace the current editor content with the last backup version. You can use undo and redo in the editor to get the old content back or to return to the restored version.”

    Adding new Administrator and Editor role users experiences the same restrictions.

    • This topic was modified 1 year, 1 month ago by johnbuol. Reason: Add WP and Pods version numbers
Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Which PHP version are you currently using?

    Thread Starter johnbuol

    (@johnbuol)

    PHP version 8.1.23.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I did not add a fix for this in Pods 3.0.5 but I’ll get this addressed in the next maintenance release.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    I have the notice fixed in Pods 3.0.6 on GitHub so it will be released when that is ready to go out maybe next week or before (depending on what other bugs get addressed).

    I’ll take a look into the capability issue you mentioned next.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Pods 3.0.6 was released with that notice fix. I still need to return to digging into your other issue you reported here.

    Thread Starter johnbuol

    (@johnbuol)

    WP 6.3.1, Pods 3.0.6, PHP 8.1.23 (Local on Windows 10)
    Update on recreating this issue. With a new WP test site only using Pods, I can recreate the Capabilities issue under the Advanced Options tab by unchecking Additional User Capabilities and leaving User Capability set to post.

    I unchecked that because I don’t want to create Additional User Capabilities for those CPTs. I’m still confused how that causes the loss of capabilities that were never created… In the new test site, rechecking it fixed the issue.

    However, on the original site, this still doesn’t fix it. The capabilities appear renewed but saving a new CPT leaves it as a Draft. Editing a previously saved CPT and then saving redirects to the Posts->All Posts menu and the CPT is never updated, even as a Draft. This is true even after deleting the Pods and recreating them, leaving the database alone.

    One attempt to save one of these CPTs yielded this error (I haven’t been able to reproduce this):
    “Deprecated: Return type of Pods\API\Whatsit\Value_Field::offsetSet($offset, $value) should either be compatible with ArrayAccess::offsetSet(mixed $offset, mixed $value): void, or the #[\ReturnTypeWillChange] attribute should be used to temporarily suppress the notice in \wp-content\plugins\pods\src\Pods\API\Whatsit\Value_Field.php on line 97”

    I’m trashing the original site to start anew as I’m at a loss on how to recover it. The only bits not working on it are the Pods-created CPTs.

    Plugin Contributor Scott Kingsley Clark

    (@sc0ttkclark)

    Fixed in Pods 3.0.9

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Pods issue causing Capabilities error’ is closed to new replies.