Skip to content
This repository has been archived by the owner on Sep 17, 2019. It is now read-only.

Existing owner is changed on update #321

Open
vpratfr opened this issue Mar 20, 2019 · 1 comment
Open

Existing owner is changed on update #321

vpratfr opened this issue Mar 20, 2019 · 1 comment

Comments

@vpratfr
Copy link
Member

vpratfr commented Mar 20, 2019

When user without permission to set ownership of content is updating document using front office add-on, the owner is reset to default set in options.

Instead, if an existing owner is detected, it should not be changed.

@vpratfr
Copy link
Member Author

vpratfr commented Mar 21, 2019

Endroit à modifier : src\php\core-classes\addon-edit-content-page.class.php

Ligne 179 environ

    public function get_default_owners()
    {
        $legacy_owner_type = $this->plugin->get_option($this->get_edit_slug_for_options() . self::$OPTION_DEFAULT_OWNER_TYPE);
        $owners = $this->plugin->get_option($this->get_edit_slug_for_options() . self::$OPTION_DEFAULT_OWNER);

        // Handle old style option
        if (!empty($legacy_owner_type)) {
            $owners = array($legacy_owner_type => $owners);
        }

        return $owners;
    }

Il faut que cette fonction retourne le propriétaire actuel du post actuellement modifié. Et si aucun propriétaire, elle retourne comme actuellement, le propriétaire par défaut.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant