Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve group association and access settings #391

Closed

Conversation

dcavins
Copy link
Collaborator

@dcavins dcavins commented Mar 24, 2014

Hi Boone-

One of my observant users noticed that while editing docs associated with a group that did not belong to her, several doc attributes were being lost on edit--the group association and access settings. Upon looking into it, I realized that the edit form doesn't include sections for users who can't "manage" the doc, but the save routine was expecting values from those fields.

I've added a couple of checks for $_POST value existence and emptiness that take those other situations into account. I left several notes in the code to explain the logic branches; please let me know if you have any questions.

Sorry I didn't notice this problem earlier!

dcavins and others added 10 commits February 20, 2014 13:57
Adds minimum bottom margin to fix layout problems.
This makes the "…and 10 more" text at the end of the tags list a
control for the expansion of the tags list. I also moved the top tags
button presentation class to a new class name separate from the class
name used to fire the expansion action.
In some cases, users can edit docs but can't manage group associations
or access settings. Previously, those attributes were being blanked out
during an edit by a user who could edit but not manage the doc, losing
group association and resetting the access settings to default.
@boonebgorges
Copy link
Owner

Wow, good catch. There are a number of other tickets that are probably
related to this one. Thanks!

On 03/24/2014 12:17 PM, dcavins wrote:

Hi Boone-

One of my observant users noticed that while editing docs associated
with a group that did not belong to her, several doc attributes were
being lost on edit--the group association and access settings. Upon
looking into it, I realized that the edit form doesn't include sections
for users who can't "manage" the doc, but the save routine was expecting
values from those fields.

I've added a couple of checks for $_POST value existence and emptiness
that take those other situations into account. I left several notes in
the code to explain the logic branches; please let me know if you have
any questions.

Sorry I didn't notice this problem earlier!


    You can merge this Pull Request by running

git pull https://github.com/dcavins/buddypress-docs preserve-group-assoc-access

Or view, comment on, or merge it at:

#391

    Commit Summary


Reply to this email directly or view it on GitHub
#391.

@boonebgorges
Copy link
Owner

Thanks again for this. I can't accept it quite as-is, because it breaks some existing functionality (the references to $_POST inside of bp_docs_set_associated_group() mean that it can no longer be used programatically or in unit tests). But you've correctly identified the issue. I'm going to move things around a bit and release a new version right away.

@dcavins
Copy link
Collaborator Author

dcavins commented Mar 25, 2014

Yes, I wondered about the reliance on the status of a $_POST array key,
especially since I've recently been importing docs programatically.

Thanks a lot for the excellent plugin.

On Tue, Mar 25, 2014 at 2:59 PM, Boone Gorges notifications@github.comwrote:

Thanks again for this. I can't accept it quite as-is, because it breaks
some existing functionality (the references to $_POST inside of
bp_docs_set_associated_group() mean that it can no longer be used
programatically or in unit tests). But you've correctly identified the
issue. I'm going to move things around a bit and release a new version
right away.

Reply to this email directly or view it on GitHubhttps://github.com//pull/391#issuecomment-38613011
.

@chriszarate
Copy link

Hooray! Thanks all around.

@dcavins dcavins deleted the preserve-group-assoc-access branch August 13, 2014 14:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants