Giter Site home page Giter Site logo

Comments (14)

typhonius avatar typhonius commented on June 25, 2024

I'm not able to recreate this. This needs to be tried on a modern browser without extensions running to verify.

from govcms7.

tomgibson avatar tomgibson commented on June 25, 2024

Issue is caused by HTML browser form validation.

Produced on:

  • Chrome Version 43.0.2357.132 (no extensions enabled)
  • Firefox 39 (no extensions enabled)

Telling me to fill in the hidden PostgreSQL on Firefox when clicking submit:
firefox_html5_validate

from govcms7.

cannod avatar cannod commented on June 25, 2024

Just also tried to install govcms and had the same problem. Firefox on linux mint. As noted workaround was to just to fill in the postgreSQL fields even though I am using MySQL.

from govcms7.

typhonius avatar typhonius commented on June 25, 2024

Reopening this issue as it seems more widespread than first thought. From any of the affected users, is this govCMS specific or do you also experience this installing Drupal minimal/standard profiles.

from govcms7.

seanhamlin avatar seanhamlin commented on June 25, 2024

The module https://www.drupal.org/project/accessible_forms adds in the HTML5 required attribute, this looks like the cause of the issue. Perhaps a simple solution is to make the the PostgreSQL fields not mandatory (through hook_form_FORMID_alter).

from govcms7.

typhonius avatar typhonius commented on June 25, 2024

Would this module be active during site install? Does Drupal boot all modules prior to anything being installed? If that's the case we should probably also decide whether this is a module bug.

from govcms7.

seanhamlin avatar seanhamlin commented on June 25, 2024

You see the red "(mandatory)" in the screenshot - I believe the module accessible_forms does this.

from govcms7.

pandaskii avatar pandaskii commented on June 25, 2024

In themes/govcms/govcms_zen/template.php line #205 it has:

$variables['element']['#attributes']['required'] = 'true';

Which adds the required="true" attribute

All browsers except Safari will respect this attribute to prevent the from from submitting

A simple fix could be in install.js, add:

for(var f=document.forms,i=f.length;i--;)f[i].setAttribute("novalidate",i)

Which will only disable browser's form validation during installation. All other form validations after installation are not affected.

from govcms7.

typhonius avatar typhonius commented on June 25, 2024

Should we also consider a template.php option instead of js?

/**
 * Adds accessibility attributes.
 */
function govcms_zen_preprocess_aria_invalid(&$variables) {
  if (!empty($variables['element']['#required']) && !drupal_installation_attempted()) {
    $variables['element']['#attributes']['required'] = 'true';
  }
  if (isset($variables['element']['#parents']) && form_get_error($variables['element']) !== NULL && !empty($variables['element']['#validated'])) {
    $variables['element']['#attributes']['aria-invalid'] = 'true';
  }
}

from govcms7.

typhonius avatar typhonius commented on June 25, 2024

The reason I was not able to replicate this before was because I do not have php pgsql drivers. When I remove the autofilled field from the SQLite settings, then attempt to proceed with MySQL settings only I see the issue.

The issue is not observed when commenting out line 205 in template.php of govcms_zen (thanks @jozhao)

from govcms7.

aleayr avatar aleayr commented on June 25, 2024

Do we have an agreed approach to this? Either the addition in the code @typhonius posted above, or commenting out/removing the line?

from govcms7.

teamglenny avatar teamglenny commented on June 25, 2024

Is this still a thing, lads?

from govcms7.

pandaskii avatar pandaskii commented on June 25, 2024

My 2 cents

@typhonius Please commit your solution ASAP 👍

from govcms7.

fiasco avatar fiasco commented on June 25, 2024

Can someone test #92 ?

from govcms7.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.