open-lms-open-source / moodle-plugin-ci

Assist with running a Moodle plugin in Travis CI
https://blackboard-open-source.github.io/moodle-plugin-ci/
GNU General Public License v3.0
43 stars 37 forks source link

Abusive rules in mustache checks #78

Closed vfremaux closed 6 years ago

vfremaux commented 6 years ago

Running moodle plugin-ci V2 on 3.4

Mustache check is complaining the following error on a template that holds a small form (block content local accessory form) :

WARNING: HTML Validation error, line 3: Bad value “” for attribute “action” on element “form”: Must be non-empty. (yform -->

<div )

Actually the template says :

which is fed by a renderer statement : $template->formurl = new moodle_url('/blocks/publishflow/backup.php'); which seems to be a quite normal way to inject a moodle well formed url in a template. Why is such a rule active and why does it not catch the variable presence rather then "empty" ?
vfremaux commented 6 years ago

After reading the mustache lint related i will also try the || true method to get it passing anyway...

polothy commented 6 years ago

Think the linter wants to see something like this, <form action="{{formurl}}">

Link to the code would help too.

dionysius commented 6 years ago

According to empty action attribute in a form: Actually you should leave it out or it has to be a valid url according to the standards.

The class moodle_url "only" handles url manipulation. It contains your desired url but it still has to be used somewhere in the template. So the interesting part is in the template to see if the variable is used correctly.

polothy commented 6 years ago

Closing old issues, please re-open with comment if you wish.