A+ incorrectly populating notes field

Hi,

I would appreciate if you could share with Hakan as I suspect we may have a bug.

I've just identified the following:-

a. The plug-in is at v1.2.6

b. We have two service providers set up with all the same settings; for this example I'll call them SP1 and SP2

c. The appointments form is set to capture the clients name, email address, phone number, and additional info (notes)

d. The settings are such that the appointment is automatically confirmed and has no payment

Appointment scenarios:-

1. An appointment (1st appointment for SP1) is made for any service for any future date and time and the fields populated. This is recorded correctly on the back end and SP1 GCAL

2. Another appointment (2nd appointment for SP1) is made exactly as item 1 and all recorded correctly.

3. Another appointment (3rd appointment and 1st for SP2) is made as item 1 except for SP2 and all recorded correctly

4. Another appointment (4th appointment and 3rd for SP1) is made and checking the backend it has changed the additional field note to the name of the service booked for this appointment and ALL previous appointments for ALL service providers (but is still recorded correctly on GCAL)

5. All future appointments for either SP are captured correctly.

I've tested a number of scenarios and it would appear to be a problem when the 3rd appointment for the same service provider is created that it changes the 'additional info' or 'note' field for that particular appointment and ALL previous appointments for ALL service providers.

If you require further clarification please let me know.

Regards
SteveB

  • pxwm

    Hi Hakan,

    Many thanks for testing and your suggestions.

    To confirm we have a test demo site and we completed a set of tests as per my post using a default theme and no custom code or hooks and everything appears to work fine.

    We then added the custom code and hooks one by one until we had effectively our live site on the demo site and it still worked fine.

    We then carried out further tests on our live site and it still fails as per the post.

    However we did notice that when it failed it not only overwrote the notes field with the service that had been booked but it also appended the word 'Appointment' on the end, e.g. if the service booked is called ‘Service1’ the notes field is changed to ‘Service1 Appointment’
    Sometimes it will overwrite the notes in the appointment that has just been booked and will always overwrite the previous appointments’ notes fields as per my original post.
    I appreciate the bug may not be in A+ but would appreciate if you could provide your thoughts were in the code/database would it be appending the word 'Appointment' as this may help us track down the problem.
    To confirm we have not made any changes to the A+ code and have only made changes through the theme functions.php.
    The appointments page itself only built using standard A+ short codes.
    Regards
    SteveB

  • pxwm

    Hi Hakan,

    I can confirm that there isn't any special characters.

    During our testing I just used the word test1, test2 etc and the notes field was overwritten with the service booked plus it appended the word 'Appointment' on the end.

    To confirm I have tried testing on the demo site with and without the custom code and I cannot get it to fail. So we are making the assumption that there is something on our live site causing the problem but we can't identify whether this is some custom code or if it relates to the settings in the A+ plugin or the way we have populated the services tab/service provider tab/GCAL tab etc.

    Regards
    SteveB

  • pxwm

    Hi Hakan,

    I think we are getting somewhere.

    Sorry for the lengthy update.

    I can confirm that the GCAL settings for each service provider are unique.

    As requested I then changed the Event summary in the GCAL tab in the main A+ admin panel from SERVICE Appointment to Testing SERVICE and NOTE.

    I then carried out a series of tests and it all seemed to work.

    I then reverted back to SERVICE Appointment and it failed as before.

    I then decided to check the setting in the GCAL tab to ensure this was all correct and I can confirm that the Primary calendar is set as 'Integration disabled'

    Even though integration was disabled I decided to remove the ‘main’ Private key but it still failed.

    However carrying out further investigation I checked the 'Event Summary' and 'Event Description' in the main GCAL tab and for each of the two service providers.

    The current settings for the ‘Event Summary’ and ‘Event Description’ for the main GCAL tab and for each service provider are:-

    1. Main GCAL tab

    >Event Summary = 'SERVICE Appointment'
    >Event Description = 'Client Name: CLIENT, Service Name: SERVICE, Service Provider Name: SERVICE_PROVIDER, Additional Notes: NOTE

    2. Service Provider1

    >Event Summary = 'SERVICE Appointment'
    >Event Description = 'Client Name: CLIENT, Service Name: SERVICE, Service Provider Name: SERVICE_PROVIDER

    3. Service Provider2

    >Event Summary = 'SERVICE Appointment'
    >Event Description = 'Client Name: CLIENT, Service Name: SERVICE, Service Provider Name: SERVICE_PROVIDER

    So the only difference between all three is the main GCAL tab has Additional Notes: NOTE included in the 'Event Description' field.

    I then deleted the Event Summary in the main GCAL tab and the appointments in the Google calendar was blank so it appears to be taking the 'Event Summary' from the main GCAL tab not from the service provider user profile.

    Is this correct?

    I then tried deleting the Event Summary from the service provider user profile but when I saved the changes it auto populated with 'Service Appointment'
    I then entered 'Testing SERVICE and NOTE' in the field and saved the changes and these were saved.

    I then deleted these and saved and it auto populated with 'SERVICE Appointment'
    The same thing happened with the 'Event Description' field.

    Where is it getting the value to auto populate?

    Is there any reason it might be failing with the Event Summary set to ‘SERVICE Appointment’ but not otherwise?

    Does this help?

    Regards
    SteveB

  • Hakan

    As requested I then changed the Event summary in the GCAL tab in the main A+ admin panel from SERVICE Appointment to Testing SERVICE and NOTE.

    I then carried out a series of tests and it all seemed to work.

    I then reverted back to SERVICE Appointment and it failed as before.

    I have no idea what is going in your case, but as you found a working solution, why don't you simply use something different than "SERVICE Appointment"?

  • pxwm

    Hi Hakan,

    Unfortunately further testing has identified that our solution does not work.

    I'm continuing our testing but would appreciate if you could confirm the following:-

    The current settings for the ‘Event Summary’ and ‘Event Description’ for the main GCAL tab and for each service provider are:-

    1. Main GCAL tab

    >Event Summary = 'SERVICE Appointment'
    >Event Description = 'Client Name: CLIENT, Service Name: SERVICE, Service Provider Name: SERVICE_PROVIDER, Additional Notes: NOTE

    2. Service Provider1

    >Event Summary = 'SERVICE Appointment'
    >Event Description = 'Client Name: CLIENT, Service Name: SERVICE, Service Provider Name: SERVICE_PROVIDER

    3. Service Provider2

    >Event Summary = 'SERVICE Appointment'
    >Event Description = 'Client Name: CLIENT, Service Name: SERVICE, Service Provider Name: SERVICE_PROVIDER

    It would appear that the google calendar obtains the 'Event Summary' from the main GCAL tab. This evidence is based on us deleting the entry in the backend main GCAL tab and then making an appointment and the google calendar 'Event Summary' was blank.

    Therefore could you confirm if the data in the two fields is used in the Service Provider profile? And should the 'Event Summary' and 'Event Description' fields be populated in the main GCAL tab and the 'Service Provider' profile page?

    I've also tried deleting the 'Event Summary' from the two service provider user profiles but when I saved the changes it auto populated with 'Service Appointment'

    Is there any reason why this field cannot be blank?
    Where is it getting the value to auto populate?

    Regards
    SteveB

  • Hakan

    I've also tried deleting the 'Event Summary' from the two service provider user profiles but when I saved the changes it auto populated with 'Service Appointment'

    Is there any reason why this field cannot be blank?
    Where is it getting the value to auto populate?

    You cannot leave those fields blank. If you leave them blank, the default values will populate, which is "SERVICE appointment". Enter another value there, e.g. SERVICE Appointment 1.

    Therefore could you confirm if the data in the two fields is used in the Service Provider profile? And should the 'Event Summary' and 'Event Description' fields be populated in the main GCAL tab and the 'Service Provider' profile page?

    No, it should not be like that. Service provider's event summary and descriptions are taken from their own settings, not from GCal tab. Tested several times and working fine for me.

    I don't really understand why you have such a problem, but please use settings like this to distinguish different cases:
    Event Summary = 'SERVICE Appointment main', 'SERVICE Appointment 1', 'SERVICE Appointment 2' for Gcal and providers 1 and 2 respectively.

  • pxwm

    Hi Hakan,

    Many thanks for your feedback.

    I've made the changes as requested and I can confirm that appointments made for SP1 and SP2 show on the google calendar as: 'SERVICE Appointment main' for both service providers.

    I also noticed the following:-

    1. Made 1st appointment for SP1 - and notes show correctly in GCAL and backend
    2. Then made 2nd appointment for SP1 - and notes show correctly in GCAL and backend
    3. Then made 1st appointment for SP2 - and notes show correctly in GCAL and backend
    4. Then made 3rd appointment for SP1 - and notes show correctly in GCAL and backend but notes for items 1,2,3 above changed to 'SERVICE Appointment main' on the backend but still shows correctly in the google calendar.
    4. I then extended the appointment time for SP2 from the google calendar and then went into SP2 user profile to purge the data and this worked fine except the notes for this 3rd appointment for SP1 notes changed to 'SERVICE Appointment main' on the backend but still shows correctly in the google calendar.

    Do you think I should delete the two SP Wordpress user profiles and re-create?

    Regards
    SteveB

    Any ideas?

  • pxwm

    Hi Hakan,

    I thought I would progress some further testing whilst waiting for confirmation from you which logs you want me to check.

    Before the further tests I upgraded the plug-in to 1.2.7

    Further test results:-

    1. I deselected the NOTE field and selected the ADDRESS field in the 'General' tab and used this as my notes field
    2. I then completed tests as before and all worked fine
    3. I then deselected the ADDRESS field and re-selected the NOTE field
    4. I then completed the tests as before and it failed replacing the text in the notes field in the admin back-end with the text from the GCAL 'Event Summary name' field. However the original notes show fine in the google calendar.
    5. I also completed some further tests in respect to the google entry fields ('Event Summary name' and the 'Event Description') and I can confirm that if I remove the text from these two fields in the main GCAL tab then the google calendar is blank.
    I can confirm that it is only the NOTE field causing this issue and I can confirm that it is using the calendar entry format from the main GCAL tab and it is not using the calendar entry format from the service provider wordpress user profile settings.

    I would appreciate if you could test item 5 above as I would like to resolve the issue with the google entry fields in the main and user profile so I can eliminate this from my testing.

    Regards
    SteveB

  • pxwm

    Hi Hakan,

    I've replaced the class.gcal.php file with yours and I'm pleased to confirm it has fixed the google entry fields in the main and user profile problem.

    It works a treat now and the information in the 'Event Summary' field for the specific SP is being written correctly in to the google calendar.

    Unfortunately it hasn't resolved the problem with the NOTE field being overwritten.

    However I can confirm that the NOTE field is being overwritten with the 'Event Summary' field from the service provider Wordpress user profile 'Event Summary'.

    Therefore if the 'Event Summary' field was set for SP1 as 'SERVICE SP1 and an appointment was made for SP1 and SERVICE1 then the NOTE field would be overwritten with SERVICE1 SP1.

    I have checked the error_log in the root of public_html and there doesn't appear to be any errors

    Any ideas what I could do to further track down this problem?

    Regards
    SteveB

  • Hakan

    I was 99% expecting this result, because the change is about which description/summary templates will be used; it isn't about your original, main issue. But I wanted to fix it in order not to leave any question marks if these issues are related. Apparently they are not related.

    I see that you have changed admin password. Can you please enable it back?

    As you have one demo website which is working and a live website which is not, can you see any server side setting differences between 2 websites, like php version, mysql version, etc?

  • pxwm

    Hi Hakan,

    Many thanks for your feedback and it is good that we have resolved the google entry fields in the main and user profile problem.

    To confirm I've changed the passwords back so you should be able to log-in to Wordpress admin.

    Do you require ftp access as well?

    Please Note: The site is live

    I can confirm the server side settings of the live and demo site are the same and they are on the same shared server.

    Regards
    SteveB

  • pxwm

    Hi Hakan,

    Good news!

    I've found what's causing the notes field to be overwritten.

    It has no relation with the number of or sequence of the appointments.

    It is when the google calendar API is updating the A+ plug-in.

    I have proved this by disabling the calendar integration for both service providers in their user profile and testing and all worked fine in the back-end notes field.

    I then changed the settings to: A+-> GCal (only export appointments) - this works fine

    I then set both user profiles to full synchronization.

    I then made a single appointment for SP1

    I then logged into the user profile of SP1 clicked on 'Import and Export Events Now' and the notes field was overwritten by the text in the 'google Event Summary' of SP1.

    I then did the same as above but left it for the default 15min update and the same thing happened.

    I would appreciate if you could test to confirm if you can replicate and if you can if you could check out the code.

    Regards
    SteveB

    and then setting it to

  • pxwm

    Hi Hakan,

    Great news.

    Uploaded the replacement file and completed further testing and all works great.

    Fantastic job and many thanks for all your support in resolving.

    Before I close the topic I do have one very minor issue which is:-

    1. In the 'Google calendar' tab I have set the 'Add Google Calendar Button' to 'No' but the button is still visible on the appointment confirmation page using the shortcode 'app_my_appointment'.

    Do you have any suggestions what could be causing this?

    Regards
    SteveB

  • Hakan

    I am glad that the main issue has been solved now.

    1. In the 'Google calendar' tab I have set the 'Add Google Calendar Button' to 'No' but the button is still visible on the appointment confirmation page using the shortcode 'app_my_appointment'.

    My appointments shortcode can (and should) override some general settings. So, the solution is using it like this:

    [app_my_appointments gcal="0"]

    On the other hand I agree that this behavior with that setting is confusing. I will consider how to make this more clear.

    Cheers,
    Hakan

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.