Commons group module remove privacy settings wrapper

Apply upstream Commons patch https://drupal.org/node/2039619.
This patch requires drush verson 6.0.0 due local patch feature.

Change-Id: I43a897b9228f7a288586e908c082c2d6619826b6
Closed-Bug: #1228206
This commit is contained in:
Marton Kiss 2013-09-23 15:11:08 +02:00
parent c956358913
commit f2a0cda66b
2 changed files with 52 additions and 0 deletions

View File

@ -60,6 +60,10 @@ projects[commons_groups][subdir] = "commons"
projects[commons_groups][download][url] = "http://git.drupal.org/project/commons_groups.git"
projects[commons_groups][download][branch] = "7.x-3.x"
; Error notice when creating or updating groups with locale module enabled
; https://drupal.org/node/2039619#comment-7854797
projects[commons_groups][patch][] = "patches/2039619-remove-privacy-settings-wrapper-4.patch"
projects[commons_pages][type] = "module"
projects[commons_pages][subdir] = "commons"
projects[commons_pages][download][url] = "http://git.drupal.org/project/commons_pages.git"

View File

@ -0,0 +1,48 @@
---
.../commons/commons_groups/commons_groups.module | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/commons_groups.module b/commons_groups.module
index 0962465..3a4eed9 100644
--- a/commons_groups.module
+++ b/commons_groups.module
@@ -92,26 +92,13 @@ function commons_groups_entity_view($entity, $type, $view_mode, $langcode) {
* Alter the privacy settings fields.
*/
function commons_groups_form_group_node_form_alter(&$form, &$form_state) {
- // Wrap the privacy fields with a fieldset.
- $form['privacy_settings'] = array(
- '#type' => 'fieldset',
- '#title' => t('Privacy settings'),
- '#weight' => 20,
- );
- $form['privacy_settings']['field_og_subscribe_settings'] = $form['field_og_subscribe_settings'];
- unset($form['field_og_subscribe_settings']);
-
- // Hide the settings label.
- $form['privacy_settings']['field_og_subscribe_settings'][LANGUAGE_NONE]['#title'] = '';
- $form['privacy_settings']['field_og_subscribe_settings'][LANGUAGE_NONE]['#required'] = FALSE;
+ // The group privacy settings are not required.
+ $form['field_og_subscribe_settings'][LANGUAGE_NONE]['#required'] = FALSE;
-
- $form['privacy_settings']['field_og_access_default_value'] = $form['field_og_access_default_value'];
- unset($form['field_og_access_default_value']);
if (module_exists('og_access')) {
// Display the private content checkbox only when "Joining requires approval"
// is selected.
- $form['privacy_settings']['field_og_access_default_value']['#states'] = array(
+ $form['field_og_access_default_value']['#states'] = array(
'visible' => array(
':input[name="field_og_subscribe_settings[' . LANGUAGE_NONE . ']"]' => array('value' => 'approval'),
),
@@ -135,7 +122,7 @@ function commons_groups_form_group_node_form_alter(&$form, &$form_state) {
* Display the private content checkbox inside the privacy settings field.
*/
function commons_groups_form_group_node_after_build($form, $form_state) {
- $form['privacy_settings']['field_og_subscribe_settings'][LANGUAGE_NONE]['approval']['#suffix'] = render($form['privacy_settings']['field_og_access_default_value']);
+ $form['field_og_subscribe_settings'][LANGUAGE_NONE]['approval']['#suffix'] = render($form['field_og_access_default_value']);
return $form;
}
--