From ab0232c022f4fbc74828c75f3ef47991883c63c2 Mon Sep 17 00:00:00 2001
From: Dries Buytaert <dries@buytaert.net>
Date: Sat, 3 Dec 2005 09:59:25 +0000
Subject: [PATCH] - Patch #37737 by asimmonds/eaton: fixed blogapi.module
 checkboxes on settings page.

---
 modules/blogapi.module         | 6 +++---
 modules/blogapi/blogapi.module | 6 +++---
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/modules/blogapi.module b/modules/blogapi.module
index 65bfe3a4c434..62f4156754ca 100644
--- a/modules/blogapi.module
+++ b/modules/blogapi.module
@@ -559,10 +559,10 @@ function blogapi_settings() {
   );
 
   $node_types = node_get_types();
-  $defaults = isset($node_types['blog']) ? array('blog') : array();
+  $defaults = isset($node_types['blog']) ? array('blog' => 1) : array();
   $form['blogapi_node_types'] = array(
     '#type' => 'checkboxes', '#title' => t('Blog types'), '#required' => TRUE,
-    '#default_value' => variable_get('blogapi_node_types', $defaults), '#options' => $node_types,
+    '#default_value' => array_keys(variable_get('blogapi_node_types', $defaults), 1), '#options' => $node_types,
     '#description' => t('Select the content types for which you wish to enable posting via blogapi. Each type will appear as a different "blog" in the client application (if supported).')
   );
 
@@ -721,7 +721,7 @@ function _blogapi_blogid($id) {
 }
 
 function _blogapi_get_node_types() {
-  $available_types = variable_get('blogapi_node_types', array('blog'));
+  $available_types = array_keys(variable_get('blogapi_node_types', array('blog' => 1)), 1);
   $types = array();
   foreach (node_get_types() as $type => $name) {
     if (node_access('create', $type) && in_array($type, $available_types)) {
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 65bfe3a4c434..62f4156754ca 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -559,10 +559,10 @@ function blogapi_settings() {
   );
 
   $node_types = node_get_types();
-  $defaults = isset($node_types['blog']) ? array('blog') : array();
+  $defaults = isset($node_types['blog']) ? array('blog' => 1) : array();
   $form['blogapi_node_types'] = array(
     '#type' => 'checkboxes', '#title' => t('Blog types'), '#required' => TRUE,
-    '#default_value' => variable_get('blogapi_node_types', $defaults), '#options' => $node_types,
+    '#default_value' => array_keys(variable_get('blogapi_node_types', $defaults), 1), '#options' => $node_types,
     '#description' => t('Select the content types for which you wish to enable posting via blogapi. Each type will appear as a different "blog" in the client application (if supported).')
   );
 
@@ -721,7 +721,7 @@ function _blogapi_blogid($id) {
 }
 
 function _blogapi_get_node_types() {
-  $available_types = variable_get('blogapi_node_types', array('blog'));
+  $available_types = array_keys(variable_get('blogapi_node_types', array('blog' => 1)), 1);
   $types = array();
   foreach (node_get_types() as $type => $name) {
     if (node_access('create', $type) && in_array($type, $available_types)) {
-- 
GitLab