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

Drupal: Fixed bug in community pref form. #2613

Merged
merged 2 commits into from Aug 7, 2018

Conversation

Projects
None yet
4 participants
@drshawnkwang
Copy link
Contributor

commented Jul 19, 2018

When saving community preference form: the user_profile is loaded. If it does not exist, there should be no 'node_save()' function call, otherwise empty nodes are created.

https://dev.gridrepublic.org/browse/DBOINCP-437

Drupal: Fixed bug in community pref form.
When saving community preference form: the user_profile is loaded. If it does not exist, there should be no 'node_save()' function call, otherwise empty nodes are created.

https://dev.gridrepublic.org/browse/DBOINCP-437
$profile_node = node_load($profile_node->nid, NULL, TRUE);
// Avatar settings - only set if profile_node exists.
if (!empty($profile_node)) {

This comment has been minimized.

Copy link
@wolzogen

wolzogen Jul 19, 2018

See PHP type comparison tables

if ($profile_node) {
    $profile_node->field_image = $edit['field_image'] ?: [];
    node_save($profile_node);
    // Flush this from the node cache or changes won't show up immediately!
    $profile_node = node_load($profile_node->nid, NULL, TRUE);
}

This comment has been minimized.

Copy link
@brevilo

brevilo Jul 23, 2018

Contributor

Thanks for your review. The author is currently out of office and will get back to you as soon as he's back.

This comment has been minimized.

Copy link
@brevilo

brevilo Jul 23, 2018

Contributor

@tristanolive any opinion on this?

This comment has been minimized.

Copy link
@drshawnkwang

drshawnkwang Aug 1, 2018

Author Contributor

Thanks for the suggestion, I've gone ahead and changed the code in the latest commit.

@tristanolive tristanolive merged commit 5ceacf6 into BOINC:master Aug 7, 2018

2 checks passed

Scrutinizer No new issues
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@drshawnkwang drshawnkwang deleted the drshawnkwang:drupal_fix-bug-emptynodes branch Aug 7, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.