Giter VIP home page Giter VIP logo

form's People

Contributors

achal-aggarwal avatar degobbis avatar dongilbert avatar eddieajau avatar elinw avatar escopecz avatar fanno avatar ianmacl avatar izharaazmi avatar javigomez avatar jbanety avatar mbabker avatar photodude avatar purplebeanie avatar realityking avatar wilsonge avatar zero-24 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

form's Issues

Making \Joomla\Form\Rule class abstract

\Joomla\Form\Rule class is a base class of form validation rules like tel, email. color etc.
As it can't be instantiated, making it an abstract class is the right approach.
If we instantiated it and run test method it will always throw exception because of empty regex.

Test Suite Compatibility w/ PHPUnit 5.4+

The test suite is still locked to PHPUnit versions 4.8 thru 5.3. Tests need to be refactored for PHPUnit 5.4+ support, then bumped to a ^4.8.35|^5.4.3|~6.0 and use the namespaced base classes as adopted in PHPUnit 6.

Different implementation of int & int_array filters.

In Form::filterField method there is filter for 'int_array' which is using ArrayHelper::toInteger and to filter 'int' it is delegating to InputFilter::clean method. so if 'A1B2C3' is filtered as int then 1 is returned, but if array('A1B2C3') is filtered as int_array then array(0) is returned.

I guess this is because of different implementation of typecasting to int in "ArrayHelper::toInteger" & in "InputFilter::clean".

If we use explicit typecasting then (int) "A1B2C3" => 0, (int) "1A2B3C" => 1 . Am I correct?

Repeatable form field type breaks when used with User form field type

The Repeatable form field type breaks when used with User form field type

Replication steps

  1. Create a standard XML form and view for a component
  2. Use the Repeatable form field type to call the User form field type as the repeatable field

Example XML code

<field name="list_users"
    type="Repeatable"
    icon="list"
    description="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_DESC"
    label="PLG_TINY_FIELD_TEMPLATE_FIELD_ELEMENTS_LABEL"
    default="{'user':['']}">
    <fields name="params">
    <fieldset hidden="true" name="list_users_modal" repeat="true">
        <field name="user_id" type="user"
            label="JGLOBAL_FIELD_MODIFIED_BY_LABEL"
            filter="unset" />
    </fieldset>
    </fields>
</field>

Expected: a repeatable field for users that would display a modal field list of selected users, which upon "adding" a user would display a modal select box of users.
Result observed: the modal select box of users does not display as a modal but replaces the existing view with a user list and no method to return to the component view after selecting a user.

Decouple hard dependency to joomla/language

The Form package should be usable without requiring all form elements be translated or the existence of the joomla/language package in general. Refactor the package to enable its use without the Language package while still supporting native translations.

Email rule passes with value="0"

In email rule we check that if a field is not required and its value is empty then it should pass validation. But value="0" passes this validation because
empty("") => true
empty("0") => true

we should not use empty in this case. We can do the required job by writing
$value === ""

Allow passing arguments to form entities (Fields, Rules)

One thing I'm missing since we've removed Factory from framework is passing data to Form entities (Fields and Rules), like a DIC.

Scenaraio:
one Rule I've build has an option to check for uniqueness of the value, for that I need an access to database and that's what I'd like to retrieve from container.

Invalid documentation - Creating Custom Fields

I highly recommend you update your documentation. I spent the last 2 hours researching an issue that your documentation said was correct.

Please use this for your documentation

namespace Joomla\Form;

class Field_<type> extends \Joomla\Form\Field
{

  public $type = '<type>';

  // Override this function
  protected function getInput()
  {
      $class = !empty($this->class) ? $this->class : "";
      return "<input class='$class' type='button' value='Agree' id='$this->id;' name='$this->name;'>";
  }
}

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.