New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Volt problem with interpreting url_field() function #13447

Closed
sera527 opened this Issue Jul 20, 2018 · 8 comments

Comments

Projects
None yet
4 participants
@sera527

sera527 commented Jul 20, 2018

I think Volt misinterprets the function url_field()

Parse error: syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')' in /var/www/html/apps/cache/_var_www_html_apps_frontend_views_client_edit.volt.php on line 131

Provide minimal script to reproduce the issue

{{ url_field("facebook","id": "facebook","class":"form-control") }}

interpreted as

<?= $this->tag->urlField('facebook', 'id' => 'facebook', 'class' => 'form-control') ?>

Details

  • Phalcon version: 3.4.0
  • PHP Version: 7.1.19
  • Operating System: Lubuntu 16.04
  • Installation type: installing via package manager
  • Server: Apache
@Jurigag

This comment has been minimized.

Member

Jurigag commented Jul 21, 2018

You forgot about array. Also github is only for NFR and bugs, for questions use forum - https://forum.phalconphp.com

@Jurigag Jurigag closed this Jul 21, 2018

@sera527

This comment has been minimized.

sera527 commented Jul 21, 2018

@Jurigag, but the Volt documentation does not contain anything about arrays.

<label for='name'>Name</label>
{{ text_field('name', 'size': 32) }}

https://docs.phalconphp.com/ru/3.3/volt#tag-helpers

@sera527

This comment has been minimized.

sera527 commented Jul 21, 2018

@Jurigag also look at this.
This line

{{ tel_field("name","class":"form-control") }}

is interpreted by Volt as

<?= $this->tag->telField(['name', 'class' => 'form-control']) ?>

And this line

{{ url_field("name","class":"form-control") }}

is interpreted by Volt as

<?= $this->tag->urlField('name', 'class' => 'form-control') ?>

Why such difference? I think it's a bug.

@Jurigag

This comment has been minimized.

Member

Jurigag commented Jul 21, 2018

https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/view/engine/volt/compiler.zep#L483 well yea you might actually be right. We need to add it there.

@Jurigag Jurigag reopened this Jul 21, 2018

@Jurigag Jurigag added the Bug - Low label Jul 21, 2018

@Jurigag Jurigag added this to the 3.4.1 milestone Jul 21, 2018

@frsbarbier

This comment has been minimized.

frsbarbier commented Jul 26, 2018

I have the same error with search_field
{{ search_field('name', 'class': 'form-control') }}

Like url_field, search_field is missing in arrayHelpers https://github.com/phalcon/cphalcon/blob/master/phalcon/mvc/view/engine/volt/compiler.zep#L483

I think it's the same with

color_field
range_field
date_time_field
date_time_local_field
month_field
time_field
week_field

CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018

Fixes phalcon#13447: Added Volt tags to array helper in Volt Compiler
Full list of tags added are as follows;
- url_field
- color_field
- range_field
- date_time_field
- date_time_local_field
- month_field
- time_field
- week_field

CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018

Fixes phalcon#13447: Added Volt tags to array helper in Volt Compiler
Full list of tags added are as follows;
* url_field
* color_field
* range_field
* date_time_field
*  date_time_local_field
* month_field
* time_field
* week_field

CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018

Fixes phalcon#13447: Added Volt tags to array helper in Volt Compiler
Full list of tags added are as follows;
* url_field
* color_field
* range_field
* date_time_field
*  date_time_local_field
* month_field
* time_field
* week_field

CameronHall added a commit to CameronHall/cphalcon that referenced this issue Oct 7, 2018

Fixes phalcon#13447: Added Volt tags to array helper in Volt Compiler
Full list of tags added are as follows;
* url_field
* color_field
* range_field
* date_time_field
*  date_time_local_field
* month_field
* time_field
* week_field

niden added a commit that referenced this issue Oct 8, 2018

Merge pull request #13514 from CameronHall/bugfix/volt-compiler
Fixes #13447: Added Volt tags to array helper in Volt Compiler
@niden

This comment has been minimized.

Member

niden commented Oct 8, 2018

This has been addressed with work by @CameronHall

@niden niden closed this Oct 8, 2018

@frsbarbier

This comment has been minimized.

frsbarbier commented Oct 11, 2018

Thanks for this fix but i think search_field was forgotten in arrayHelpers.

niden added a commit to niden/cphalcon that referenced this issue Oct 11, 2018

niden added a commit that referenced this issue Oct 11, 2018

Merge pull request #13521 from niden/3.4.x
[#13447] - Added search_field in the volt compiler helpers
@niden

This comment has been minimized.

Member

niden commented Oct 11, 2018

@frsbarbier I just added it. Nice catch. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment