View Issue Details

This bug affects 1 person(s).
 14
IDProjectCategoryView StatusLast Update
08735Bug reportsTheme editorpublic2014-02-26 17:31
Reportersth Assigned ToDenisChenu  
PriorityhighSeverityminor 
Status closedResolutionfixed 
Product Version2.05+ 
Fixed in Version2.05+ 
Summary08735: "Exit and clear survey" button text is a link <a> which adopts the <a> CSS-style (color)
Description

As soon as the "a:link, a:visited" CSS color of a template is beeing defined, the "Exit and clear survey" button text adopts the link color because the text isn't a <button> anymore, it has an <a> tag now.

Steps To Reproduce

Open a survey with e.g. the "default" template, take a look at the "Exit and clear survey" button - it has a different color (link color).

Additional Information

Every 2.0 template where a link color is defined shows the same problem.

TagsNo tags attached.
Attached Files
problem.jpg (163,241 bytes)
Bug heat14
Complete LimeSurvey version number (& build)131219
I will donate to the project if issue is resolvedNo
BrowserChrome (Mac)
Database type & versionMysql 5
Server OS (if known)Apache 2
Webserver software & version (if known)Apache 2
PHP Version5.3

Relationships

related to 08772 closedDenisChenu Escaping single quotes in gT translation method output string isn't safe 

Users monitoring this issue

c_schmitz

Activities

Mazi

Mazi

2014-02-17 20:56

updater   ~28800

I think we lack a little backwards compatibility here and since the "wrong" link can be a little annoying when having your own CSS link styles, we should make this work as at Limesurvey 2.0.

tpartner

tpartner

2014-02-17 21:07

partner   ~28801

Over to you Denis - https://github.com/LimeSurvey/LimeSurvey/commit/cd16db1dc0ae63e1d462991206b0a3afe6f89aac

DenisChenu

DenisChenu

2014-02-17 22:24

developer   ~28803

No button, leave a link but fix included template.

We don't have global css actually, then can not fix for all.

Mazi

Mazi

2014-02-18 09:14

updater   ~28805

Denis, I don't consider fixing the shipped templates a reasonable solution. What about all those users with custom templates? They all need to adjust their templates as well.
It would be of a far bigger help if we just stick to the original button element.

DenisChenu

DenisChenu

2014-02-18 10:18

developer   ~28806

Last edited: 2014-02-18 10:19

We already broke a lot of user template between 2.0 and 2.05. And here, it's only a css issue.

All citronade based template are completely broken: JS broken ...

PS: why not stick to original : because clear all is a link, it's really a link. Why don't use link if it's a link ?
PS2: in 1.90 version and older : clearall are already an a link

DenisChenu

DenisChenu

2014-02-18 10:20

developer   ~28807

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=13908

DenisChenu

DenisChenu

2014-02-18 10:27

developer   ~28808

Last edited: 2014-02-18 10:30

We can do :
$(function() {
$("a.confirm-needed").each(function(){
$(this).replaceWith($("<button id='"+$(this).attr('id')+"'class='"+$(this).attr('class')+"' title='"+$(this).attr('title')+"'>"+$(this).html()+"</button>"));
});
});

But i think it's not really needed.

Topic for tomorrow ;)

Mazi

Mazi

2014-02-18 10:39

updater   ~28809

Denis, thanks for the fix but I think we should discuss this at today's DEV meeting because from my point of view there can be a far easier fix and I don't see the benefit of your solution for our users.
So please put your commit on hold until we have discussed this.

DenisChenu

DenisChenu

2014-02-18 10:42

developer   ~28810

Benefits : a link is a link. Work in all browser even without javascript. More clean for screen reader (tested by a friend of mine).

sth

sth

2014-02-18 11:41

reporter   ~28811

I don't think that just because of "We already broke a lot of user template between 2.0 and 2.05" that justifies breaking some more stuff. I don't understand what speaks against making this a button as it was at the previous Limesurvey 2.0 version.

The current solution causes me quite some trouble using Limesurvey because I need to fix several custom templates manually and I am sure I am not the only user having that problem.

sammousa

sammousa

2014-02-19 14:13

reporter   ~28819

Decision based on dev meeting.

  • Revert <a> tag to a <button> tag.
  • Add a class to it that identifies this is a delete button.
  • Add script that:
    • Uses the forms data-confirmation attribute to show a confirmation message.
    • After confirmation sends a HTTP DELETE request.
  • Update the clear and exit function to only accept DELETE requests.

This will solve the OPs problem and will remove 1 incorrect usage of HTTP GET.

DenisChenu

DenisChenu

2014-02-19 14:23

developer   ~28820

Why not move to $_POST and redirect ? With a confirmed=="Y" ?

DenisChenu

DenisChenu

2014-02-19 18:10

developer   ~28827

For remind :

DenisChenu

DenisChenu

2014-02-19 19:14

developer   ~28828

Last edited: 2014-02-20 08:40

Think best is :

  • Clicking in this button open a new form
    One with DELETE (confirm)
    And one with cancel

And after we can do it ajax : with a beatifull confirm box or with a javascript confirm() like now ...

Remind:
1.92 and 1.00 are : <input type="button" onclick="if (confirm('Êtes-vous sûr de vouloir effacer toutes vos réponses?')) {
window.open('/index.php/975921/move/clearall/lang/fr', '_self')}" class="clearall" value="Sortir et effacer vos réponses" name="clearallbtn">

A window open only too ...

DenisChenu

DenisChenu

2014-02-20 10:01

developer   ~28830

Fix committed to master branch: http://bugs.limesurvey.org/plugin.php?page=Source/view&amp;id=13912

DenisChenu

DenisChenu

2014-02-20 10:02

developer   ~28831

Fix the button only : other must be in 2.06 or 2.1

c_schmitz

c_schmitz

2014-02-20 11:29

administrator   ~28832

I think that the solution with that extra dialog (separate form) is the best one, but as you said, for 2.06 or 2.1

DenisChenu

DenisChenu

2014-02-20 12:48

developer   ~28833

Yes and need rewriting controllers/survey/index.php .....

c_schmitz

c_schmitz

2014-02-26 13:32

administrator   ~28948

2.05+ Build 140226 released

Related Changesets

LimeSurvey: master b47f30c1

2014-02-18 09:20:37

DenisChenu

Details Diff
Fixed issue 08735: "Exit and clear survey" css style for shiped template
Dev: fix some issue with IE7
Dev: add button class to some other submit button
Affected Issues
08735, 08772
mod - application/helpers/frontend_helper.php Diff File
mod - application/helpers/replacements_helper.php Diff File
mod - scripts/survey_runtime.js Diff File
mod - templates/basic/template.css Diff File
mod - templates/bluengrey/template.css Diff File
mod - templates/citronade/template.css Diff File
mod - templates/default/template.css Diff File
mod - templates/eirenicon/template.css Diff File
mod - templates/limespired/template.css Diff File
mod - templates/mint_idea/template.css Diff File
mod - templates/sherpa/template.css Diff File
mod - templates/vallendar/template.css Diff File

LimeSurvey: master 8c9c6382

2014-02-20 09:01:48

DenisChenu

Details Diff
Fixed issue 08735: "Exit and clear survey" button text is a link <a> which adopts the <a> CSS-style (color)
Dev: Fix the button only, other must be in dev for 2.06 or 2.1
Affected Issues
08735
mod - application/helpers/SurveyRuntimeHelper.php Diff File
mod - application/helpers/frontend_helper.php Diff File
mod - application/helpers/replacements_helper.php Diff File
mod - scripts/survey_runtime.js Diff File

LimeSurvey: master ad7e7026

2014-02-20 09:34:58

DenisChenu

Details Diff
Dev: 08735 : use text for confirm not html Affected Issues
08735
mod - application/helpers/replacements_helper.php Diff File
mod - scripts/survey_runtime.js Diff File

Issue History

Date Modified Username Field Change
2014-02-17 19:43 sth New Issue
2014-02-17 19:43 sth File Added: problem.jpg
2014-02-17 20:55 Mazi Assigned To => tpartner
2014-02-17 20:55 Mazi Status new => assigned
2014-02-17 20:56 Mazi Note Added: 28800
2014-02-17 21:07 tpartner Note Added: 28801
2014-02-17 21:08 tpartner Assigned To tpartner => DenisChenu
2014-02-17 22:24 DenisChenu Note Added: 28803
2014-02-18 09:14 Mazi Note Added: 28805
2014-02-18 10:18 DenisChenu Note Added: 28806
2014-02-18 10:18 DenisChenu Note Edited: 28806
2014-02-18 10:18 DenisChenu Note Edited: 28806
2014-02-18 10:19 DenisChenu Note Edited: 28806
2014-02-18 10:20 DenisChenu Changeset attached => LimeSurvey master b47f30c1
2014-02-18 10:20 DenisChenu Note Added: 28807
2014-02-18 10:20 DenisChenu Resolution open => fixed
2014-02-18 10:27 DenisChenu Note Added: 28808
2014-02-18 10:30 DenisChenu Note Edited: 28808
2014-02-18 10:39 Mazi Note Added: 28809
2014-02-18 10:42 DenisChenu Note Added: 28810
2014-02-18 11:41 sth Note Added: 28811
2014-02-18 15:28 Mazi Issue Monitored: c_schmitz
2014-02-19 14:13 sammousa Note Added: 28819
2014-02-19 14:23 DenisChenu Note Added: 28820
2014-02-19 18:10 DenisChenu Note Added: 28827
2014-02-19 19:14 DenisChenu Note Added: 28828
2014-02-20 08:38 DenisChenu Note Edited: 28828
2014-02-20 08:40 DenisChenu Note Edited: 28828
2014-02-20 10:01 DenisChenu Changeset attached => LimeSurvey master 8c9c6382
2014-02-20 10:01 DenisChenu Note Added: 28830
2014-02-20 10:02 DenisChenu Note Added: 28831
2014-02-20 10:02 DenisChenu Status assigned => resolved
2014-02-20 10:02 DenisChenu Fixed in Version => 2.05+
2014-02-20 10:36 DenisChenu Changeset attached => LimeSurvey master ad7e7026
2014-02-20 11:29 c_schmitz Note Added: 28832
2014-02-20 12:48 DenisChenu Note Added: 28833
2014-02-26 13:32 c_schmitz Note Added: 28948
2014-02-26 13:32 c_schmitz Status resolved => closed
2014-02-26 17:31 DenisChenu Relationship added related to 08772
2015-12-11 14:40 c_schmitz Category Templates => Theme editor
2021-08-03 10:06 guest Bug heat 12 => 14