diff options
author | Dries Buytaert <dries@buytaert.net> | 2005-06-06 18:59:37 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2005-06-06 18:59:37 +0000 |
commit | eb803411d1586f04adf3fab966cc26b40c17927e (patch) | |
tree | ce76dc990cb33a7068564da35b6ed3689333bf3b | |
parent | 8436082fe1364dfe35461e5d8fc737a43c06abee (diff) | |
download | brdo-eb803411d1586f04adf3fab966cc26b40c17927e.tar.gz brdo-eb803411d1586f04adf3fab966cc26b40c17927e.tar.bz2 |
- Patch #24003 by Steven: fix problems with node attribute checking (and improve defaults).
-rw-r--r-- | database/database.mysql | 2 | ||||
-rw-r--r-- | database/database.pgsql | 2 | ||||
-rw-r--r-- | modules/blogapi.module | 8 | ||||
-rw-r--r-- | modules/blogapi/blogapi.module | 8 |
4 files changed, 12 insertions, 8 deletions
diff --git a/database/database.mysql b/database/database.mysql index eca633468..334561860 100644 --- a/database/database.mysql +++ b/database/database.mysql @@ -822,3 +822,5 @@ INSERT INTO variable (name,value) VALUES ('filter_html_1','i:1;'); INSERT INTO locales_meta (locale, name, enabled, isdefault) VALUES ('en', 'English', '1', '1'); INSERT INTO url_alias (src, dst) VALUES ('node/feed', 'rss.xml'); + +INSERT INTO variable (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:"status";}'); diff --git a/database/database.pgsql b/database/database.pgsql index 0fbdc6686..8485c6623 100644 --- a/database/database.pgsql +++ b/database/database.pgsql @@ -817,6 +817,8 @@ INSERT INTO locales_meta (locale, name, enabled, isdefault) VALUES ('en', 'Engli INSERT INTO url_alias (src, dst) VALUES ('node/feed', 'rss.xml'); +INSERT INTO variable (name, value) VALUES ('node_options_forum', 'a:1:{i:0;s:6:"status";}'); + --- --- Alter some sequences --- diff --git a/modules/blogapi.module b/modules/blogapi.module index 3c6172837..a6c73a0d7 100644 --- a/modules/blogapi.module +++ b/modules/blogapi.module @@ -118,13 +118,13 @@ function blogapi_new_post($req_params) { $edit = array(); $edit['type'] = _blogapi_blogid($params[0]); // get the node type defaults - $node_type_default = variable_get('node_options_'. $edit['type'], array()); + $node_type_default = variable_get('node_options_'. $edit['type'], array('status', 'promote')); $edit['uid'] = $user->uid; $edit['name'] = $user->name; - $edit['promote'] = $node_type_default['promote']; + $edit['promote'] = in_array('promote', $node_type_default); $edit['comment'] = variable_get('comment_'. $edit['type'], 2); - $edit['moderate'] = $node_type_default['moderate']; - $edit['revision'] = $node_type_default['revision']; + $edit['moderate'] = in_array('moderate', $node_type_default); + $edit['revision'] = in_array('revision', $node_type_default); $edit['format'] = FILTER_FORMAT_DEFAULT; $edit['status'] = $params[4]; diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module index 3c6172837..a6c73a0d7 100644 --- a/modules/blogapi/blogapi.module +++ b/modules/blogapi/blogapi.module @@ -118,13 +118,13 @@ function blogapi_new_post($req_params) { $edit = array(); $edit['type'] = _blogapi_blogid($params[0]); // get the node type defaults - $node_type_default = variable_get('node_options_'. $edit['type'], array()); + $node_type_default = variable_get('node_options_'. $edit['type'], array('status', 'promote')); $edit['uid'] = $user->uid; $edit['name'] = $user->name; - $edit['promote'] = $node_type_default['promote']; + $edit['promote'] = in_array('promote', $node_type_default); $edit['comment'] = variable_get('comment_'. $edit['type'], 2); - $edit['moderate'] = $node_type_default['moderate']; - $edit['revision'] = $node_type_default['revision']; + $edit['moderate'] = in_array('moderate', $node_type_default); + $edit['revision'] = in_array('revision', $node_type_default); $edit['format'] = FILTER_FORMAT_DEFAULT; $edit['status'] = $params[4]; |