Events Made Easy Forums How do I … Custom event attributes disappear after server move

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #42888
    Anonymous
    Inactive

    Hello,

    Most of my events have three custom attributes set.

    Before moving my site from a staging server to a live domain, I tried a test import-export from my staging server to a local virtual host on my machine, using my usual method (Make a copy of public_html & an export of the site’s whole SQL database. Update wp-config and do a find & replace on the SQL export changing the old domain to the new one).

    When I opened this test export of the site on my virtual host, all my blog posts, and other WP content had made it across OK. My events were there, but all the custom attributes fields for each event were empty in the WP admin interface, and were not displaying in the site’s front-end.

    Oddly, though, everything seems intact when I look at the DB through phpmyadmin. Here are the “event_attributes” for the same event, copied from phpmyadmin, on both the staging server (where everything is working as expected) and the local virtual host event_attributes (no attributes displayed anywhere on site).

    staging server event_attributes

    a:3:{s:11:"Event Image";s:80:" http://staging.serialspace.org/wp-content/uploads/2011/05/electrofringe2008.jpg";s:15:"Event Thumbnail";s:87:"http://staging.serialspace.org/wp-content/uploads/2011/05/electrofringe2008-248x248.jpg";s:13:"Cost/Donation";s:4:"free";}

    local virtual host event_attributes

    a:3:{s:11:"Event Image";s:80:" http://serialspace.dev/wp-content/uploads/2011/05/electrofringe2008.jpg";s:15:"Event Thumbnail";s:87:"http://serialspace.dev/wp-content/uploads/2011/05/electrofringe2008-248x248.jpg";s:13:"Cost/Donation";s:4:"free";}

    Anyone have any idea of what’s going on here?

    Thanks.

    #47832
    Franky
    Keymaster

    If you change the content, also change the sizes. Here you changed the url, but you neglected to change the size indicator “s:80” to match the new size (I’m guessing it should be “s:72”)

    #47833
    Anonymous
    Inactive

    Right, OK.

    I manually updated the size indicators on one record to match the actual length of the URL, and my custom attributes are now behaving as expected for that event.

    Is there any way to update these size indicators automatically? As the image filename lengths are not all consistent, the size indicators will be different for each event — I guess I need all of them to be 8 less than their current values.

    #47834
    Anonymous
    Inactive

    I have found a workaround, but I don’t really like it: using a find/replace to add some extra spaces (in my case, eight) to the beginning of the URL as it appears in the “event_attributes” column.

    a:3:{s:11:"Event Image";s:80:"[eight spaces here]http://serialspace.dev/wp-content/uploads/2011/05/electrofringe2008.jpg";s:15:"Event Thumbnail";s:87:"[eight spaces here]http://serialspace.dev/wp-content/uploads/2011/05/electrofringe2008-248x248.jpg";s:13:"Cost/Donation";s:4:"free";}

    (edit — the extra spaces are stripped out by bbpress — I have used [eight spaces here] instead.

    #47835
    Franky
    Keymaster

    It’s a php serializing standard, you need to follow it if you manually change things. So no autmatically updating possible. Best thing to do is to calculate the length of the string and replace things with a script.

Viewing 5 posts - 1 through 5 (of 5 total)
  • The forum ‘How do I …’ is closed to new topics and replies.
Scroll to Top