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

New contact fields handling #8

Open
kolinko-ant opened this issue Sep 13, 2017 · 14 comments
Open

New contact fields handling #8

kolinko-ant opened this issue Sep 13, 2017 · 14 comments

Comments

@kolinko-ant
Copy link

kolinko-ant commented Sep 13, 2017

Hi!

Thanks for you library, it's helpful.

I have an error right now type "array" is not a valid autopilot data type (AutopilotField.php line 311), because of new array fields coming in autopilot response, i.e.:

  • mail_received
  • mail_opened
  • anywhere_page_visits
  • anywhere_utm .

Is there a chance to fix it and handle these new fields? Or you don't maintain anymore this library?

Thanks in advance.

@nicolasThal
Copy link
Contributor

Hi,

We are still using this library on our live website.

I haven't saw any kind of error lately, but I will look a little bit through it.

If you have an idea for a fix, I will be more than pleased to review and accept it !

Thanks for your help !

@kolinko-ant
Copy link
Author

I think, such fields are optional and may present or not in your contact response, it depends on what input data comes to autopilot.

To fix it, it's good to understand why do you restrict array type for the field?

@kolinko-ant
Copy link
Author

Oh, i see in doc - because of custom fields probaby

@kolinko-ant
Copy link
Author

kolinko-ant commented Sep 13, 2017

As a fix I suggest to detect such fields by checking that it's not $reservedFields and it's not $casts field. If so, put such fields to some array like unchangableFields and then just send them as to saveContact method.

Or another idea - just extend $casts array with such fields.

You know better, what fix will be the most correct. What do you think?

@kolinko-ant
Copy link
Author

@nicolasThal
Here is the implementation of the last idea - #9

@nicolasThal
Copy link
Contributor

@kolinko-ant, As I am not the creator of the lib, I need some time to see the changes implicated by your modification.

I am also looking for a test case that can break the existing code, in order to validate your modification.

What does the autopilot response looks like with the array fields ?

@kolinko-ant
Copy link
Author

What does the autopilot response looks like with the array fields ?

http://take.ms/fv1tE

@nicolasThal
Copy link
Contributor

Thank you for the dataset !

I tried to add it to the test case that are already created but without any success.
So I have two questions :

@kolinko-ant
Copy link
Author

kolinko-ant commented Sep 14, 2017

@nicolasThal

I tried to add it to the test case that are already created

could you point me to this test case?

@nicolasThal
Copy link
Contributor

The test are located in this file : https://github.com/dekalee/php-autopilothq/blob/master/tests/unit/AutopilotFieldCest.php#L128

To run it, you could launch the command : ./vendor/bin/codecept run after a composer install.

I have added a small commit to the master branch to avoid some php warning, you could rebase your branch to have it.

@kolinko-ant
Copy link
Author

I will take a look to it. Thanks

@nicolasThal
Copy link
Contributor

Hi @kolinko-ant ,

How are you progressing with the test case ?

Did do you do other modifications to make the code work ?

@nicolasThal
Copy link
Contributor

Hi @kolinko-ant

I wish you a happy new year.

How are you progressing with the test case ?

@nicolasThal
Copy link
Contributor

Hi @kolinko-ant,

I am still ok to merge your pr in the main code to avoid package duplication.

Did you look throught the test writting ?

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

No branches or pull requests

2 participants