Chamilo-lms: Announcements: possible to send empty title and body

Created on 24 Apr 2017  路  8Comments  路  Source: chamilo/chamilo-lms

Current behavior / Resultado actual / R茅sultat actuel

Empty-title announcements can be sent. That is undesired because you cannot click the message anymore.

Expected behavior / Resultado esperado / R茅sultat attendu

In older versions Chamilo used to check on empty title and refude to send. That is still the expected bahaviour.

Steps to reproduce / Pasos para reproducir / 脡tapes pour reproduire

click create announcement icon and hit "send announcement" without entering anyting

Chamilo Version / Versi贸n de Chamilo / Version de Chamilo

1.11.4 (git pull 24-4-2017)

afbeelding

Bug

All 8 comments

I've made a fix for that bug. #1890
image

(cc @moy)

Very good!
Maybe add the rule on the body also:
$form->addRule('content', get_lang('ThisFieldIsRequired'), 'required');

Just to prevent people forgetting entering a message.

@jderriks Maybe instead of making the body field required it would be preferable to print a warning message ?
Like when you are sending a empty mail in most of mails boxes (Gmail, etc).

Sure, go ahead. It's more code.

I tried using some javascript on the validating butting but I didn't find a way to access the html editor text of content.
They must be a way since 'required' verify if a field is filled. Does anyone know where it is defined ?

Content is set by:
$form->addHtmlEditor( 'content',

I just added a fix for the announcement description.

Works.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ywarnier picture ywarnier  路  3Comments

vfremaux picture vfremaux  路  5Comments

AldoAbdiel picture AldoAbdiel  路  3Comments

linkmoises picture linkmoises  路  7Comments

480419140 picture 480419140  路  5Comments