drupal installatie
Heb net Drupal geinstalleerd en ben bezig een basispagina te maken.
Wanneer ik naar Beheer: Basispagina ga, krijg ik de volgende mededeling:
Notice: Undefined property: stdClass::$body in htmltidy_node_prepare() (regel 28 van /home/vrijloop/domains/indevrijloop.nl/public_html/sites/all/modules/htmltidy-7.x-1.x-dev/htmltidy/htmltidy.node.inc).
Warning: Invalid argument supplied for foreach() in htmltidy_node_prepare() (regel 28 van /home/vrijloop/domains/indevrijloop.nl/public_html/sites/all/modules/htmltidy-7.x-1.x-dev/htmltidy/htmltidy.node.inc).
Ik neem aan dat er een fout, in de door mij geinstalleerde module zit,
(misschien ook wel een instellingsfout in de module)
n.l. in de module htmltidy,
ik ben echter totaal leek in PHP.
Kan iemand mij helpen?
"of je bent iets vergeten te declareren"
Een waarschuwing (warning) is een melding "U bent iets verkeerds aan het doen en het gaat zeer waarschijnlijk fout in de toekomst, dus please fix it."
Zowel de mededelingen en waarschuwingen betekent niet dat de uitvoering van je script stopt, maar ik wil je wel aanraden deze aan te passen om eventuele "fouten" te voorkomen in de toekomst.
Een warning is 'je hebt het fout gedaan en denk erom, ik ga het niet nog een keer vergeven'.
Beide fouten zul je dus gewoon moeten oplossen, want het feit dat het werkt komt met 99% zekerheid alleen omdat PHP zo extreem soepel is in alles.
Hoe je het moet oplossen kunnen we nu nog niet zeggen, daar hebben we te weinig informatie voor.
Ga eens naar het bestand dat is aangegeven en geef ons even de code van Regel 20 - 40. Dan kunnen we waarschijnlijk meer voor je betekenen.
Please copy contents of the library folder in the HTML Purifier tarball or zip to this folder or ensure HTMLPurifier.auto.php exists. You can download HTML Purifier at htmlpurifier.org.
Wat wordt er verstaan onder de HTML Purifier tarball ?
Toevoeging op 21/04/2012 20:12:37:
Ik heb het gedownload "HTML Purifier" en geupload naar de map
/home/vrijloop/domains/indevrijloop.nl/public_html/sites/all/modules
Toevoeging op 21/04/2012 20:15:22:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
<?php
/**
* @file
* The HTML Tidy hook implementations for Drupal's Node system.
*/
/**
* Implementation of hook_node_prepare().
*/
function htmltidy_node_prepare($node) {
// Get a list of all formats that have this filter enabled.
$formats = db_query(
'SELECT format, settings FROM {filter}
WHERE module = :module AND name = :name AND status = 1',
array(
'module' => 'htmltidy',
'name' => 'htmltidy',
)
)->fetchAllKeyed();
// Iterate through each field.
$field_list = field_info_instances('node', $node->type);
foreach ($field_list as $field_name => $field_data) {
// Iterate through the language of each field.
foreach ($node->$field_name as $language => $instances) {
// Iterate through each language's instance.
foreach ($instances as $instance_id => $instance) {
// Get a reference to the contents of this instance.
$contents =& $node->{$field_name}[$language][$instance_id]['value'];
// Act only on instances that are set to something.
if(isset($contents)){
// Determine the text format of the instance.
$format =& $node->{$field_name}[$language][$instance_id]['format'];
// It's possible that the format may not be set because some field
// types (like plain text) don't specify text formats. As such, they
// won't want any filters run on them. We can simply ignore these
// instances.
// Check if this format has our filter enabled.
if (isset($format) && array_key_exists($format, $formats)) {
// If there are any settings, format them properly and remove
// any extraneous data elements.
if (isset($formats[$format])) {
$settings = unserialize($formats[$format]);
$settings = $settings['htmltidy_filter_' . $format];
}
// If not, create an empty container.
$settings = isset($settings) ? $settings : array();
// Replace the contents with a tidied version of itself.
$contents = htmltidy_fragment($contents, $settings, $errors, $warnings);
// Report any errors.
if (!empty($errors)) {
$errors = array_map('htmlentities', $errors);
form_set_error('body', theme('item_list', $errors));
}
}
}
}
}
}
}
/**
* Implementation of hook_node_validate().
*/
function htmltidy_node_validate($node) {
$body_contents = $node->body['und'][0]['value'];
$input_format = filter_format_load($node->body['und'][0]['format']);
$query = db_query('SELECT status FROM {filter} WHERE format= :format AND module=:module', array('format' => $input_format->format, 'module'=> 'htmltidy'));
if ($query->fetchField() == 1) {
global $_htmltidy_filter;
if (isset($body_contents)) {
// call the filters so if they're using html tidy as a filter it'll
// be called in order
check_markup($body_contents, $input_format->format);
if (isset($_htmltidy_filter['filtered']) && $_htmltidy_filter['filtered']) {
$errors = $_htmltidy_filter['errors'];
$warnings = $_htmltidy_filter['warnings'];
}
else {
$clean = htmltidy_fragment($body_contents, array(), $errors, $warnings);
form_set_value(array('#parents' => array('body')), $clean, $a3);
}
if ($errors || $warnings) {
$message = '<p>Original body:</p><pre>'. htmlentities($body_contents) .'</pre>';
if ($errors) {
$message .= theme('item_list', array_map('htmlentities', $errors));
form_set_error('body', $message);
}
if ($warnings) {
drupal_set_message("The following HTML errors have been cleaned up automatically for you: " . theme('item_list', array_map('htmlentities', $warnings)));
}
}
}
}
}
/**
* @file
* The HTML Tidy hook implementations for Drupal's Node system.
*/
/**
* Implementation of hook_node_prepare().
*/
function htmltidy_node_prepare($node) {
// Get a list of all formats that have this filter enabled.
$formats = db_query(
'SELECT format, settings FROM {filter}
WHERE module = :module AND name = :name AND status = 1',
array(
'module' => 'htmltidy',
'name' => 'htmltidy',
)
)->fetchAllKeyed();
// Iterate through each field.
$field_list = field_info_instances('node', $node->type);
foreach ($field_list as $field_name => $field_data) {
// Iterate through the language of each field.
foreach ($node->$field_name as $language => $instances) {
// Iterate through each language's instance.
foreach ($instances as $instance_id => $instance) {
// Get a reference to the contents of this instance.
$contents =& $node->{$field_name}[$language][$instance_id]['value'];
// Act only on instances that are set to something.
if(isset($contents)){
// Determine the text format of the instance.
$format =& $node->{$field_name}[$language][$instance_id]['format'];
// It's possible that the format may not be set because some field
// types (like plain text) don't specify text formats. As such, they
// won't want any filters run on them. We can simply ignore these
// instances.
// Check if this format has our filter enabled.
if (isset($format) && array_key_exists($format, $formats)) {
// If there are any settings, format them properly and remove
// any extraneous data elements.
if (isset($formats[$format])) {
$settings = unserialize($formats[$format]);
$settings = $settings['htmltidy_filter_' . $format];
}
// If not, create an empty container.
$settings = isset($settings) ? $settings : array();
// Replace the contents with a tidied version of itself.
$contents = htmltidy_fragment($contents, $settings, $errors, $warnings);
// Report any errors.
if (!empty($errors)) {
$errors = array_map('htmlentities', $errors);
form_set_error('body', theme('item_list', $errors));
}
}
}
}
}
}
}
/**
* Implementation of hook_node_validate().
*/
function htmltidy_node_validate($node) {
$body_contents = $node->body['und'][0]['value'];
$input_format = filter_format_load($node->body['und'][0]['format']);
$query = db_query('SELECT status FROM {filter} WHERE format= :format AND module=:module', array('format' => $input_format->format, 'module'=> 'htmltidy'));
if ($query->fetchField() == 1) {
global $_htmltidy_filter;
if (isset($body_contents)) {
// call the filters so if they're using html tidy as a filter it'll
// be called in order
check_markup($body_contents, $input_format->format);
if (isset($_htmltidy_filter['filtered']) && $_htmltidy_filter['filtered']) {
$errors = $_htmltidy_filter['errors'];
$warnings = $_htmltidy_filter['warnings'];
}
else {
$clean = htmltidy_fragment($body_contents, array(), $errors, $warnings);
form_set_value(array('#parents' => array('body')), $clean, $a3);
}
if ($errors || $warnings) {
$message = '<p>Original body:</p><pre>'. htmlentities($body_contents) .'</pre>';
if ($errors) {
$message .= theme('item_list', array_map('htmlentities', $errors));
form_set_error('body', $message);
}
if ($warnings) {
drupal_set_message("The following HTML errors have been cleaned up automatically for you: " . theme('item_list', array_map('htmlentities', $warnings)));
}
}
}
}
}