Skip to content
Snippets Groups Projects
Commit 7919edc0 authored by Devin Zuczek's avatar Devin Zuczek Committed by Devin Zuczek
Browse files

Issue #2397701 by michaelmol, djdevin, idebr: Title is overwritten if title is already filled in.

parent a5f8e36f
No related branches found
No related tags found
No related merge requests found
......@@ -97,7 +97,7 @@ abstract class QuizQuestion {
'#title' => t('Title'),
'#maxlength' => 255,
'#default_value' => $this->node->title,
'#required' => FALSE,
'#required' => TRUE,
'#description' => t('Add a title that will help distinguish this question from other questions. This will not be seen during the @quiz.', array('@quiz' => QUIZ_NAME)),
);
}
......
......@@ -428,7 +428,7 @@ function quiz_question_node_presave($node) {
$q_types = quiz_question_get_info();
foreach ($q_types as $q_type => $info) {
if ($node->type == $q_type) {
if (drupal_strlen($node->title) == 0 || !user_access('edit question titles')) {
if (drupal_strlen($node->title) == 0) {
$body = field_view_field('node', $node, 'body', array('label' => 'hidden'));
$markup = strip_tags(drupal_render($body));
if (drupal_strlen($markup) > variable_get('quiz_autotitle_length', 50)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment