Closed (duplicate)
Project:
Address Field Phone
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
2 May 2015 at 14:25 UTC
Updated:
9 Sep 2016 at 08:58 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
basillic commentedThis patch should fix these errors.
Comment #2
ashopin commentedThanks, the notices are gone.
Comment #3
avo webworks commentedThe patch failed
Hunk #1 FAILED at 33.
Hunk #2 FAILED at 43.
Hunk #3 FAILED at 53.
Hunk #4 FAILED at 63.
4 out of 4 hunks FAILED
Comment #4
tuchoIf you install the module and activate de addressfield_phone plugin, the user can complete all the phone types.
But if you select some of the types and then deselect them, leaving all the types deselected, the fields are not shown at the form, unless you select all of them.
I attached a patch and an interdiff with the correction of this bug.
Comment #5
jcisio commentedI don't understand why the order is inverted. Doesn't the following work, too? It is a minimal change (replace "$a" with "!empty($a)").
if (!empty($settings['extension']) || !$settings) {Comment #6
tuchoYou're right.
I have just copied the order from the previous patch. It will work too if we mantain the original order of the conditions.
But the
$settingsvariable may not always be defined, so we need to check it's existence withempty($settings)instead of!$settingsAnother way to avoid this posibility is initializing the
$settingsvariable, for example, at line 31 of the file plugins/format/phone.inc as$settings = array();.I think that the second choice makes a smaller patch. If you agree, I can update the patch with these two changes.
Comment #7
fchandler commentedThis says 7.x-1.x-dev but am getting the message in 7.x-1.2. I am not really a php person, so will this patch work on the 7.x-1.2 release?
Upon further investigation, It does not happen on my live site - D7.37, MySQL 5.5.32, php5.3.13, Apache/2, but does on my local dev site - D7.37, MySQL 5.5.43-0ubuntu0.14.04.1, php5.5.9-1ubuntu4.9, Apache/2.4.7 (Ubuntu). All modules up to date.
Comment #8
fchandler commentedAgain, will this patch work on the 7.x-1.2? What is an interdiff? What do I use?
As it turns out, I am getting this error on the live site. I just have error messages turned off. The fields show, and I am just assuming they are collecting data correctly.
D7.37, Drupal commerce 7.x-1.11, Address field 7.x-1.1, Address Field Phone 7.x-1.2, MySQL 5.5.32, php5.3.13, Apache/2, All modules are up to date.
Comment #9
tucho@fchandler right now, the dev version is the same code of the latest release, so the patch should apply.
If you want to apply the patch, you can read some info here.
Comment #10
LukM commentedHas this patch been committed to the dev version yet?
As a noob, I have no idea how to patch, and spent hours downloading programs and trying to figure out how that works, but couldn't get it right. :-(
Sorry.
Comment #11
fchandler commentedGot the patch applied and the message stopped. Unchecked all phone field check boxes, all appear. Check specific phone fields and only those appear. Patch #4 works for me. Did not do anything with the interdiff, except to look at it and see the difference.
D7.37
Address Field 7.x-1.1
Address Field Phone 7.x-1.2
Drupal Commerce 7.x-1.11
Comment #12
Arne Slabbinck commentedPatch #4 fixed and got rid of the notices for me!
D7.41
Address Field 7.x-1.1
Address Field Phone 7.x-1.2
Drupal Commerce 7.x-1.11
Comment #13
jcisio commented#2500725: Undefined index in addressfield_phone_handler_field_address_phone_nr.inc
Comment #14
roy_k commentedI had this errror and solve it by changing the line, for example:
I added the isset() and it seems to solve it.