WordPress.org

Ready to get started?Download WordPress

Forums

My Calendar
[resolved] Improper URL encoding for Regions (13 posts)

  1. gwheeler
    Member
    Posted 1 year ago #

    Hello,

    I'm using My Calendar Plugin Version 2.1.5 by Joe Dolson. Previously, I had been able to filter events by Region. Recently though I have experienced an issue with this feature. It appears that the space character is not properly encoded in the URL when filtering events by region. For example:

    On my page http://kypride.org/calendar/ you can filter events by county, which is using the Region field. When I select "Adair County" it returns the following URL:
    http://kypride.org/calendar/?ltype=region&cid=all&loc=Adair%2BCounty

    It should return:
    http://kypride.org/calendar/?ltype=region&cid=all&loc=Adair%20%County

    As you can see, the space is encoded as %2B instead of %20%. If you manually edit the URL accordingly, you will see the proper results.

    Any assistance would be appreciated.

    Thanks,
    Gretchen

    http://wordpress.org/extend/plugins/my-calendar/

  2. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    I'll check this out. That's an odd result; it indicates that encoding is happening, just not of the space character. %2b is the plus character, which suggests that the encoding is just happening at the wrong time.

  3. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    It took a while, but I found this - and it wasn't a URL encoding issue at all. Turns out that 'region' wasn't one of the registered location list types, so it was trying to search on region, but using the wrong data to do it.

    I'm working on getting version 2.2 out the door, but if you're comfortable making a minor tweak, here it is:

    file: my-calendar-output.php

    Insert after line 1203:

    case "region":$data = "location_region";
    break;

    Because I spent a chunk of time going down the wrong path, this may not be the *only* tweak required -- I slightly lost track of whether I'd made any other changes. However, this should be the only thing you need.

  4. gwheeler
    Member
    Posted 1 year ago #

    Hi Joe,

    Thanks for looking into the issue. I made the change but unfortunately it does not seem to be working. Assuming I implemented the tweak correctly...

    Any further assistance is greatly appreciated.

    -Gretchen

  5. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    Yep - you're right. There's another place. Insert the same code after line 1257 in the same file.

    Best,
    Joe

  6. gwheeler
    Member
    Posted 1 year ago #

    Hi Joe,

    Sorry to say, it still doesn't appear to be working :(. I placed it in both locations as follows:

    case "country":$data = "location_country";
    break;
    case "region":$data = "location_region"; //Tweak added to fix region filter
    break;
    default:$data = "location_label";
    break;

    If that is incorrect, please let me know.

    Thanks,
    Gretchen

  7. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    No, that's fine. Hmm. I'll do some other checking. I don't currently have 2.1.5 installed, but I found this was still a bug in 2.2.0; it may be there's something else I inadvertently fixed during dev for 2.2.0 that is separate. I'll have to check that.

    Sorry about this...

    Best,
    Joe

  8. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    I just tested with just these two changes, and it worked in a version of 2.1.5. But I had a thought: in what order did you do things? Did you create your events, then add the regions to your locations, or did you create the locations with regions, then add your events?

    The location data is *not* directly tied to the event data; so if you created the events before assigning the regions to locations, then your events do not currently contain that information.

    In the next release, I aim to have an option to auto propagate changes, but that is not available yet (and will have some caveats, as well.)

  9. gwheeler
    Member
    Posted 1 year ago #

    Hi Joe,

    Thanks for all you assistance. To answer your question, I maintain the website (to the best of my ability) but another user typically enters the event information. I can't speak with absolute certainty but I am of the understanding that they enter the location/region from the drop down as they add the event the first time. The locations rarely change and were created some time ago.

    Just in case though, I created a test event and added the county from the drop down on the add events page. You can see the test event at http://www.kypride.org/calendar/ It's marked for today 4-11-13 and is titled "location test event for pulaski 2". However, when I choose "pulaski county" from the drop down and submit it does not show.

    Just to provide you with more background information... The regions were working previously. The region information is vital this time of year due to the activity of the organization and so it was only recently reported to me that it had ceased to function. I ran all updates hoping to fix the issue, including an update to my calendar, but it did not resolve it. Which is when I submitted it here.

    And, just in case this is of any relevance here's the shortcode I used to display the drop down:
    [my_calendar_locations show="form" type="saved" datatype="region"]

    If you have any other thoughts or suggestions as to the cause, it would be most welcomed.

    Thanks,
    Gretchen

  10. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    If you could submit a support request and grant me access to your site, I'd be glad to try and investigate this further - what you posted as what you did looks right, but I could check it in situ and verify. But, as far as I can tell, those two changes should be sufficient - and I'm not certain why it's still not working for you!

  11. gwheeler
    Member
    Posted 1 year ago #

    Thanks Joe. I submitted a support request from the My Calendar help tab within wordpress. Please let me know if you do not receive it or if I should submit through your website or other means.

    -Gretchen

  12. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    No, I don't seem to have received it. Try my web site contact form, instead: http://joedolson.com/contact.php

  13. Joe Dolson
    Member
    Plugin Author

    Posted 1 year ago #

    Problem was in caching; will be reviewed for next release. Resolved!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.