Skip to content
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

[ticket/11010] HTML5 input types for form fields #1000

Merged
merged 32 commits into from May 21, 2013
Merged

[ticket/11010] HTML5 input types for form fields #1000

merged 32 commits into from May 21, 2013

Conversation

senky
Copy link
Contributor

@senky senky commented Sep 30, 2012

The proposal is to use the new input types for form fields(new HTML5 feature). The idea is to use types like email and url to the browser automatically validate the fields.

RFC & discussion: http://area51.phpbb.com/phpBB/viewtopic.php?f=108&t=43159

http://tracker.phpbb.com/browse/PHPBB3-11010

PHPBB3-11010

@brunoais
Copy link
Contributor

Interesting... It's the 1000th PR! PARTY!

@@ -161,7 +161,7 @@
'PLACE_INLINE' => 'Place inline',
'POLL_DELETE' => 'Delete poll',
'POLL_FOR' => 'Run poll for',
'POLL_FOR_EXPLAIN' => 'Enter 0 or leave blank for a never ending poll.',
'POLL_FOR_EXPLAIN' => 'Enter 0 for a never ending poll.',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the initial value? If initial value is empty and user is required to enter 0, I don't think this is acceptable.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initial value is 0. Also, if you post a blank string, it gets replaced by 0. So that is why.

@p
Copy link
Contributor

p commented Oct 11, 2012

Two questions:

  1. What happens if an older browser encounters this markup? And by "older" I mean 1) firefox 3 and 2) links/lynx.
  2. I assume styles team approves of this PR?

@p
Copy link
Contributor

p commented Oct 11, 2012

Just noticed that subsilver2 received some of these changes, 1) do we really want that and 2) I seem to recall subsilver staying html4, is this going to be an issue?

@senky
Copy link
Contributor Author

senky commented Oct 11, 2012

Inputs of unknown types falls back to type="text", so no harm is made. It was discussed in RFC.

I am not sure about subsilver2 then. Vinny did the original changes and included subsilver2, but if you want, I can delete commits that change subsilver2.

@vinny
Copy link
Member

vinny commented Oct 16, 2012

What happens if an older browser encounters this markup? And by "older" I mean 1) firefox 3 and 2) links/lynx.

@p the field will be analyzed as normal, ie as a simple text input.

Just noticed that subsilver2 received some of these changes, 1) do we really want that and 2) I seem to recall subsilver staying html4, is this going to be an issue?

The current subsilver2 is with HTML5 (<!DOCTYPE html>), however the new HTML5 input types usually work, only need the browser support.

@p
Copy link
Contributor

p commented Oct 17, 2012

OK then, sounds like you have all the bases covered. Please take out the .orig file.

@p
Copy link
Contributor

p commented Oct 22, 2012

In 3b2c53d: second line of commit message is not space: and removing it from prosilver wher it should not be.

@p
Copy link
Contributor

p commented Oct 22, 2012

There were 2 failures:

  1. phpbb_functions_acp_build_cfg_template_test::test_build_cfg_template_dimension with data set #0 (array('dimension', 20, 255), 'key_name', array(10, 20), 'config_key_name', array(), ' x ')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -' x '
    +' x '

/home/phpdev/test-phpbb/tests/functions_acp/build_cfg_template_test.php:89
/home/pie/apps/git-phpunit-bundle/phpunit.php:44

  1. phpbb_functions_acp_build_cfg_template_test::test_build_cfg_template_dimension with data set Develop olympus #1 (array('dimension', 0, 255), 'key_name', array(10, 20), 'config_key_name', array(), ' x ')
    Failed asserting that two strings are equal.
    --- Expected
    +++ Actual
    @@ @@
    -' x '
    +' x '

/home/phpdev/test-phpbb/tests/functions_acp/build_cfg_template_test.php:89
/home/pie/apps/git-phpunit-bundle/phpunit.php:44

@p
Copy link
Contributor

p commented Oct 22, 2012

Someone needs to fix the test suite, the rest of it looks a-ok to me.

@senky
Copy link
Contributor Author

senky commented Oct 22, 2012

I would like to reword 3b2c53d, but when I do git rebase, with its parent, it wants me to rebase more than 200 commits, more of them with problems which interupts rebasing process. Could you lead me on how to reword that old commit without that much pain using git rebase? I could not find anything on the internet...

@p
Copy link
Contributor

p commented Oct 22, 2012

That is probably anywhere between difficult and impossible, you can leave it alone.

@p
Copy link
Contributor

p commented Oct 22, 2012

The simplest thing probably would be to start on current develop and cherry-pick each commit in this PR. If you get major conflicts, again, you can leave it be.

@p
Copy link
Contributor

p commented Oct 22, 2012

Actually it doesn't look so bad.

git checkout ticket/11010
git rebase -i upstream/develop

Delete any commits not listed in this PR.

Fix conflicts, there should only be 1 or 2.

If you do this please squash the commit deleting the orig file into the commit that added it.

After you do this, rebase again and reword the offending commit.

@senky
Copy link
Contributor Author

senky commented Oct 23, 2012

In fact it is a problem. I did everything according to your instructions. There were 2 conflicts. I resloved them. I could not squash commit, because I cannot find commit adding .orig file. Whatsmore, After I finished rebasing, it resulted in error, that ref cannot be updatet because it should be on another commit that it is:

error: Ref refs/heads/ticket/11010 is at 9bcd9bbd5bf97d824a53735de3ceca82540dfea
5 but expected 9c7afaaf8576482b034def672bae4ca783b3a960
fatal: Cannot lock the ref 'refs/heads/ticket/11010'.

I fixed it by modifying commit ID in .git/refs/heads/ticket/11010, but after I tried to rebase it again to reword the commit, it gave me hute lost of commits again.

Well, I do not know it it is possible to reword it. I have another idea: I can just simply copy all files and create new PR, include only one commit adding everything in this PR.

@p
Copy link
Contributor

p commented Oct 23, 2012

Most likely you did not start with a clean tree/staging area/rebase state etc. and that is why you received that error.

Make sure you completely cancel out any rebases in progress and your repository is in good shape.

Then rebase this branch on develop without any changes to commits. Only fix the conflicts. Checkpoint the result.

Then rebase and reword the commit.

Then rebase and squash orig delete. To find out which commit added it:

git blame HEAD^ path.orig

after you do all the other steps.

@senky
Copy link
Contributor Author

senky commented Oct 28, 2012

Ok I give up. I tried to do it with your instructions, but after I fixed conflicts and ran rebase again, the same conflicts appeared (any yes, I used git add .). I have given you collab access to my fork, so if you have time, I would be glad to see it fixed and merged.

$size = (int) $tpl_type[1];
$maxlength = (int) $tpl_type[2];
$min = (int) $tpl_type[1];
$max = $maxlength = (int) $tpl_type[2];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was an API change. The first parameter was size and is now min.

I don't see dimension being used anywhere in phpbb tree, therefore you may be able to do this but you need to get approval from more developers.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay with me.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is still not right.

min/max refer to the magnitude of the value, maxlength refers to the number of digits in the value. For a max=1000, maxlength=4.

maxlength could perhaps be a ceil(log10(max)).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Behavior like this should not change, it will break any mod that uses this in the ACP and it will probably not be the easiest to recognize why this changed.

Doesn't number do what you changed dimension to?

@p
Copy link
Contributor

p commented Oct 29, 2012

I did the first rebase, you can now reword that commit.

Tests fail due to an API change - see my previous comment.

@p
Copy link
Contributor

p commented Oct 29, 2012

In 5a936918d1c6a8b912553486cda7d2ebf49249eb: second line of commit message is not space: and removing it from prosilver wher it should not be.

@senky
Copy link
Contributor Author

senky commented Oct 29, 2012

Ok I tried, even though some problems occured. I hope it is fine now. And about your comment to dimension: you have already fixed the problem with a14aaee or am I to fix it?

@p
Copy link
Contributor

p commented Nov 6, 2012

  1. The last merge you did you should not have done.

git checkout ticket/11010
git reset --hard a14aaee50fc4e5beb5df1da4f26873dbbe510488

  1. As I said, you changed the API which requires discussion and approval. You can either revert to the old API which will require changes in the diff, or post an RFC for the API change you have done.

@senky
Copy link
Contributor Author

senky commented Nov 6, 2012

@p
Copy link
Contributor

p commented Dec 2, 2012

This massively conflicted with the colon merge.

@p
Copy link
Contributor

p commented Dec 6, 2012

@senky please merge or rebase on develop to deal with the colon conflicts.

@senky
Copy link
Contributor Author

senky commented Dec 6, 2012

Ok I will try. If it will be too problematic, I will maybe rewrite all changes to newest source and push it here.

@senky
Copy link
Contributor Author

senky commented Jan 7, 2013

I have successfully rebased on develop and resolved all conflicts with L_COLON. I hope it is ready to merge now.

senky and others added 17 commits May 20, 2013 18:40
Add new HTML5 input types to installer

PHPBB3-11010
Add all new HTML5 input types to functions_acp.php, handle them as text for now

PHPBB3-11010
Change input type to search for search forms
Replace search placeholder JS with placeholder attribute
Add style for search placeholder

PHPBB3-11010
Add type="email" to fields that should be email fields
Change back to type="text" fields that might have wildcards or not necessary email

PHPBB3-11010
@senky
Copy link
Contributor Author

senky commented May 20, 2013

@EXreaction tests are failing, but after inspection, you can see, that the problem is in downloading dependencies, so travis problem. Tests should pass.

@@ -399,8 +399,7 @@ function main($id, $mode)
'legend1' => 'ACP_SECURITY_SETTINGS',
'allow_autologin' => array('lang' => 'ALLOW_AUTOLOGIN', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'allow_password_reset' => array('lang' => 'ALLOW_PASSWORD_RESET', 'validate' => 'bool', 'type' => 'radio:yes_no', 'explain' => true),
'max_autologin_time' => array('lang' => 'AUTOLOGIN_LENGTH', 'validate' => 'int:0', 'type' => 'text:5:5', 'explain' => true, 'append' => ' ' . $user->lang['DAYS']),
'ip_check' => array('lang' => 'IP_VALID', 'validate' => 'int', 'type' => 'custom', 'method' => 'select_ip_check', 'explain' => true),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What happened to this setting?

@EXreaction
Copy link
Contributor

Besides the config setting that went missing, I think everything looks acceptable. If someone else would please review all the changes as well and respond back if they think everything looks good that would be very helpful since there were so many changes here and it's easy to miss something.

case 'range':
case 'search':
case 'tel':
case 'time':
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done twice

@senky
Copy link
Contributor Author

senky commented May 21, 2013

Thanks for your comments. Problems have been resolved. I hope now it is ok.

@cyberalien
Copy link
Contributor

Looks good. Can't find any errors

@EXreaction EXreaction merged commit 721bc03 into phpbb:develop May 21, 2013
@EXreaction
Copy link
Contributor

Merged, thanks for all the hard work!

@senky
Copy link
Contributor Author

senky commented May 21, 2013

Yeah! Finally after 8 months :). Thanks to all collaborators!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
9 participants