掲示板

Multiple Address Bug?

15年前 に Mike Ring によって更新されました。

Multiple Address Bug?

New Member 投稿: 16 参加年月日: 07/12/18 最新の投稿
I'm running into a bug with adding a second address. It seems to be a problem with naming the street address fields.

I am using Community 5.2.2, and it shows up both in the source downloads and in the Tomcat bundle.

The following steps should replicate the problem:
1. Log in as any user. It is easiest to see if the user has no addresses registered
2. Go to "My Account"
3. Select "Addresses"
4. Fill in the address fields that are shown by default.
5. Click the "+" symbol to add a new address.
At this point, I get an error in my Tomcat logs--a java.lang.IllegalArgumentException--that comes from a json service problem.
6. Fill in the new address information, click "Save"
7. My first address will save correctly.
My second address will save the city, zip code, type, and the mailing checkbox. It will then throw an error and ask me to enter a valid street. Now if I re-enter the address, it will save correctly.

You can also move step 6 (clicking "Save") to before you add a new address (step 5) and it gives the same errors.

The problem that I see is that in the first address, the Street Address 1 field has a value of "addressStreet10." In the second address, all of the Street Address values have input values of "addressStreet2," while the code is looking for something that would be like "addressStreet12."

It seems that the JavaScript call to create a new address isn't working quite right. Any help would be great.
thumbnail
15年前 に Amos Fong によって更新されました。

RE: Multiple Address Bug?

Liferay Legend 投稿: 2047 参加年月日: 08/10/07 最新の投稿
Hey Mike,

It looks like the javascript to add a new row is interpreting the 1,2,3 after address as part of the index.

from auto_field.js

var oldName = el.attr('name');
var originalName = oldName.replace(/([0-9]+)$/, '');
var newName = originalName + newSeed;
15年前 に Mike Ring によって更新されました。

RE: Multiple Address Bug?

New Member 投稿: 16 参加年月日: 07/12/18 最新の投稿
Amos,
That looks like it. I'm not sure how to fix it short of making two separate replace methods, one for address fields (or fields where the base name has a number following it), and one for all other fields. In theory, you could get up to having double-digit numbers of addresses (and I don't know what all this addRow method is used for), so you wouldn't be able to differentiate fields with just one regex.

Thoughts on how to fix it, and should I put this in JIRA?
thumbnail
15年前 に Amos Fong によって更新されました。

RE: Multiple Address Bug?

Liferay Legend 投稿: 2047 参加年月日: 08/10/07 最新の投稿
I'm not sure how to fix it short of making two separate replace methods, one for address fields (or fields where the base name has a number following it), and one for all other fields. In theory, you could get up to having double-digit numbers of addresses (and I don't know what all this addRow method is used for), so you wouldn't be able to differentiate fields with just one regex.


I can't think of a good way either because you can hit add from any address. The only thing I can think of for now is changing the names to StreetA, StreetB, etc. But you would have to change the java classes too, and this could be potentially breaking elsewhere. If you come up with anything better, please share. =)

Thoughts on how to fix it, and should I put this in JIRA?

Definitely =) thanks
15年前 に Mike Ring によって更新されました。

RE: Multiple Address Bug?

New Member 投稿: 16 参加年月日: 07/12/18 最新の投稿
Posted to JIRA here:

http://issues.liferay.com/browse/LPS-2815

We'll just work around it until a fix happens.
13年前 に Rayn Rayn によって更新されました。

RE: Multiple Address Bug?

New Member 投稿: 3 参加年月日: 10/07/22 最新の投稿
I am using Liferay 6.0.5(latest) Community Edition

When i login as test@liferay.com ---> control panel ---> MyAccount and then edit details of test i.e. Admin.
I just enter the details then go to address page fill the address details --> phone details----> web url----> email ids.
Save it.

Things gets saved immedately but when try deleting address enter multiple address press '+' and '-' button and enter multiple phone details '+' and '-', and then save the MyAccount page it gets saved.

But still i repeat steps and try playing with Address,Phone details,WebUrl and Email Id and save. then ALL THE DETAILS GETS DELETED AUTOMATICALLY..!

when i check the Data base (Oracle) the results gets deleted..!

Please can u get me patch of this issue..



I have also raise the issue in JIRA
http://issues.liferay.com/browse/LPS-14446
thumbnail
13年前 に Sergio González によって更新されました。

RE: Multiple Address Bug?

Expert 投稿: 301 参加年月日: 10/01/07 最新の投稿
Hi Rayn,
I think this has been fixed here: LPS-12353. Could you please check if this solution works for you?
Cheers!