Commit 55ad8aec authored by salvis's avatar salvis
Browse files

Issue #2879092 by Aron Novak: Generating text - PHP 7.1 warning.

parent 2f0db7d7
......@@ -478,29 +478,11 @@ function devel_generate_word($length){
return substr($word, 0, $length);
}
function devel_create_content($type = NULL) {
$nparas = mt_rand(1,12);
$type = empty($type) ? mt_rand(0,3) : $type;
$output = "";
switch($type % 3) {
// MW: This appears undesireable. Was giving <p> in text fields
// case 1: // html
// for ($i = 1; $i <= $nparas; $i++) {
// $output .= devel_create_para(mt_rand(10,60),1);
// }
// break;
//
// case 2: // brs only
// for ($i = 1; $i <= $nparas; $i++) {
// $output .= devel_create_para(mt_rand(10,60),2);
// }
// break;
default: // plain text
for ($i = 1; $i <= $nparas; $i++) {
$output .= devel_create_para(mt_rand(10,60)) ."\n\n";
}
function devel_create_content() {
$nparas = mt_rand(1, 12);
$output = '';
for ($i = 1; $i <= $nparas; $i++) {
$output .= devel_create_para(mt_rand(10,60)) . "\n\n";
}
return $output;
......
......@@ -21,9 +21,9 @@ function _text_devel_generate($object, $field, $instance, $bundle) {
if (empty($field['settings']['max_length'])) {
// Textarea handling
$object_field['value'] = devel_create_content($format);
$object_field['value'] = devel_create_content();
if ($instance['widget']['type'] == 'text_textarea_with_summary' && !empty($instance['display_summary'])) {
$object_field['summary'] = devel_create_content($format);
$object_field['summary'] = devel_create_content();
}
}
else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment