? ? Pending

User tests: Successful: Unsuccessful:

avatar sandewt
sandewt
28 Aug 2017

Pull Request for issue #17126.

Summary of Changes

Some code.

Testing Instructions

Instructions, see issue #17126

  • Go to Single Contact.
  • Fill in the form.
  • Do not fill in captcha.
  • Send email.

Expected result

Warning + textboxes are NOT empty.

Actual result

All textboxes are empty, so the user has to fill in AGAIN all textboxes.

Documentation Changes Required

No.

Thanks to

@pascal-910

avatar joomla-cms-bot joomla-cms-bot - change - 28 Aug 2017
Category Front End com_contact
avatar sandewt sandewt - open - 28 Aug 2017
avatar sandewt sandewt - change - 28 Aug 2017
Status New Pending
avatar sandewt
sandewt - comment - 28 Aug 2017

I'm new on Github.
If I have downloaded the code and look to the characters.
So I see in my editer, that after the "{" and the "}" braces (accolades) is a tab. In line 76 and 78. (NOK.)
How can I avoid this in github by making a PR?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.
avatar sandewt
sandewt - comment - 28 Aug 2017

Ask for input.

Is the following code nessecary?

empty($item->catid)

In the DB table xxx_content is defined:

`catid` int(10) UNSIGNED NOT NULL DEFAULT '0'

So the catid may not be empty !?


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar n9iels
n9iels - comment - 28 Aug 2017

The patch works fine for me.

Is the following code nessecary?

There is never a problem with extra test :-). However in this situation only !empty($item->catid) is enough. !isset($item->catid) will only check if the $item object has a 'catid' property. !empty($item->catid) will check if the $item object has a 'catid' property, and this property is not empty. See this post for more information:

https://stackoverflow.com/questions/7191626/isset-and-empty-what-to-use#answer-7191642

If you change this I can conform the test via the J!Issue tracker.

avatar sandewt
sandewt - comment - 28 Aug 2017

Thanks, interesting post.

Do you mean!empty($item->catid) or empty($item->catid) is enough? Because catid is not empty.
The function $app->setUserState(..) may not be executed in this situation!


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar sandewt sandewt - change - 1 Sep 2017
Labels Added: ?
avatar sandewt
sandewt - comment - 1 Sep 2017

Do not fiil in captcha. After send all data form loses after postback !!!

contactform

avatar sandewt sandewt - close - 1 Sep 2017
avatar sandewt sandewt - change - 1 Sep 2017
Status Pending Closed
Closed_Date 0000-00-00 00:00:00 2017-09-01 08:50:58
Closed_By sandewt
avatar sandewt
sandewt - comment - 1 Sep 2017

Sorry, a mistake for closing!!

avatar sandewt sandewt - change - 1 Sep 2017
Status Closed New
Closed_Date 2017-09-01 08:50:58
Closed_By sandewt
avatar sandewt sandewt - change - 1 Sep 2017
Status New Pending
avatar sandewt sandewt - reopen - 1 Sep 2017
avatar sandewt
sandewt - comment - 23 Sep 2017

Please test this PR #17126 or give comment.

avatar conconnl conconnl - test_item - 7 Oct 2017 - Tested successfully
avatar conconnl
conconnl - comment - 7 Oct 2017

I have tested this item successfully on 8004b7a


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar slibbe slibbe - test_item - 7 Oct 2017 - Tested successfully
avatar slibbe
slibbe - comment - 7 Oct 2017

I have tested this item successfully on 8004b7a


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar franz-wohlkoenig franz-wohlkoenig - change - 8 Oct 2017
Status Pending Ready to Commit
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Oct 2017

RTC after two successful tests.

avatar wojsmol
wojsmol - comment - 8 Oct 2017
avatar franz-wohlkoenig
franz-wohlkoenig - comment - 8 Oct 2017

@wojsmol means this Comment not RTC?

avatar wojsmol
wojsmol - comment - 8 Oct 2017

@franz-wohlkoenig Let's leve desicion to one of maainterners. Code my to be a little simpler, but both versions works.

avatar sandewt sandewt - change - 9 Oct 2017
Labels Added: ?
avatar sandewt
sandewt - comment - 9 Oct 2017

On closer inspection and the comments, the following:

In the Joomla! core rarely used the combination of 'isset and empty', and not for no reason.
So I choise for the proposal of @niels that one test is enough.
I expect a string for $item->catid (gettype) which is p.e. '16'. And not '' or '0'.
So I prefer 'empty' in stead of '!isset' if the user state ($app->setUserState) is not yet set.
See also: http://php.net/manual/en/types.comparisons.php

So I changed the code, PLEASE TEST AGAIN.

avatar sandewt sandewt - change - 9 Oct 2017
Status Ready to Commit Closed
Closed_Date 0000-00-00 00:00:00 2017-10-09 11:08:39
Closed_By sandewt
avatar sandewt sandewt - close - 9 Oct 2017
avatar sandewt
sandewt - comment - 9 Oct 2017

Sorry for closing, issue should be open @franz-wohlkoenig.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar brianteeman
brianteeman - comment - 9 Oct 2017

re-opened

avatar brianteeman brianteeman - change - 9 Oct 2017
Status Closed New
Closed_Date 2017-10-09 11:08:39
Closed_By sandewt
Labels Removed: ?
avatar brianteeman brianteeman - change - 9 Oct 2017
Status New Pending
avatar brianteeman brianteeman - reopen - 9 Oct 2017
avatar sandewt
sandewt - comment - 9 Oct 2017

Thanks Brian, and @niels should be @n9iels.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar Quy Quy - test_item - 12 Dec 2017 - Tested successfully
avatar Quy
Quy - comment - 12 Dec 2017

I have tested this item successfully on 9377adb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar franz-wohlkoenig
franz-wohlkoenig - comment - 16 Dec 2017

@conconnl @slibbe can one of you please test?

avatar Sieger66 Sieger66 - test_item - 7 Jan 2018 - Tested successfully
avatar Sieger66
Sieger66 - comment - 7 Jan 2018

I have tested this item successfully on 9377adb


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/17743.

avatar Quy Quy - change - 7 Jan 2018
Status Pending Ready to Commit
avatar Quy
Quy - comment - 7 Jan 2018

RTC

avatar mbabker mbabker - change - 8 Jan 2018
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2018-01-08 17:18:44
Closed_By mbabker
Labels Added: ?
avatar mbabker mbabker - close - 8 Jan 2018
avatar mbabker mbabker - merge - 8 Jan 2018
avatar ReLater
ReLater - comment - 18 Apr 2018

Looks like this pr has opened another issue. See #20195 please.

avatar infograf768
infograf768 - comment - 22 Apr 2018

@sandewt
Please look at #20195 (comment)

Add a Comment

Login with GitHub to post a comment