Josh Davenport-Smith

Designer, Developer & Creator based in London

My blog where I usually talk about web related issues

Warning: is_writable(): Unable to find the wrapper “tcp” – Magento, Memcached and Sessions

Recently had an issue on a production Magento instance where I was finding the following warning output to system.log on every page hit

Warning: is_writable(): Unable to find the wrapper "tcp"

I couldn’t find anyone else who’d encountered this same issue so here are my findings:

It transpired that session data was being saved in files (this is default for Magento) in the /tmp/ directory of the filesystem. At first I couldn’t work out why on earth this would be happening as I though I’d set up Magento to use memcached, so why would sessions be saving to files?

Well, once looking in /app/etc/local.xml, it turned out the node was present with memcached connection details (tcp://127.0.0.1:11211 etc) but the node was missing.

The result was that Magento was defaulting to the file session save method and passing a path with tcp:// handle to the is_writable() method. This obviously was returning false and so Magento was writing session data to it’s fallback location in the /tmp/ directory and outputting a log entry that the “tcp” wrapper (tcp://) couldn’t be found

This is was a bit of silly human error but hopefully if anybody ever has this issue they’ll find this info!

WP Reactivate Theme

This plugin provides a utility to reactivate the currently active WordPress theme.

Useful primarily for helping with development, the plugin will allow you to swiftly trigger code that is hooked into the ‘after_switch_theme’ and ‘switch_theme’ actions. Before, you had to switch to an alternative theme and back to the original, now you only need to find Tools > Reactivate Theme.

Download

Quform/iphorm Capabilities – A Complete List

I recently compiled a list of capabilities that NextGEN gallery uses. I stumbled upon the same issue with quform (otherwise known as iphorm). There doesn’t seem to be a complete list in any documentation that I could find. So far anybody who may need it in the future, here is a list of capabilities it uses:

  • iphorm_build_form
  • iphorm_delete_entry
  • iphorm_delete_form
  • iphorm_export
  • iphorm_help
  • iphorm_import
  • iphorm_list_forms
  • iphorm_preview_form
  • iphorm_save_form
  • iphorm_view_entries

NextGEN Gallery Capabilities – A Complete List

As part of the latest project I’ve been involved in I needed to take full control of WordPress users access via the WordPress Roles/Capabilities API. I needed to take full control of which NextGEN gallery backend tasks our client can carry out. This is was in an effort to make the backend easer for less experienced users but also to clean things up a little.

I couldn’t find a complete list of capabilites used in the plugin’s code so I’ve compiled it. This list is complete as of version 1.9.7. Here goes:

  • NextGEN Add new gallery
  • NextGEN Add/Delete album
  • NextGEN Change options
  • NextGEN Change style
  • NextGEN Edit album
  • NextGEN Edit album settings
  • NextGEN Edit gallery author
  • NextGEN Edit gallery description
  • NextGEN Edit gallery options
  • NextGEN Edit gallery page id
  • NextGEN Edit gallery path
  • NextGEN Edit gallery preview pic
  • NextGEN Edit gallery title
  • NextGEN Gallery overview
  • NextGEN Import image folder
  • NextGEN Manage gallery
  • NextGEN Manage others gallery
  • NextGEN Manage tags
  • NextGEN Upload a zip
  • NextGEN Upload images
  • NextGEN Upload in all galleries
  • NextGEN Use TinyMCE

Unlike core WordPress code, the plugin uses role values that are in plain English. This list has the exact values used via current_user_can throughout.

Implied consent is a valid form of consent

At the very last minute, the ICO has published new guidance on the highly controversial EU cookie law. Companies like BT must be slightly annoyed at this changing of the goalposts, considering the amount of work they clearly put into managing their cookie use across parts of their highly cookie reliant website.

Here’s one of the most important new clarifications: Implied consent is a valid form of consent and can be used in the context of compliance with the revised rules on cookies. Read the extra points in the new guidelines for even more specificity on this. However, the general theme here it seems is: Use cookies for reasons beneficial to the users and you don’t need permission, just make your users aware of how you’re using cookies.

Use analytics for improving your user experience? Fine. Use external services that use cookies? Fine. Just make it clear to the user what you’re doing

“It’s about telling users that actually here are the things that we do to make your experience of our site much better than it could be and we hope you agree to that. And actually selling the benefits, whether it’s personalisation of the services we provide to people, which can range from remembering their name, or remembering who they are so the next time they don’t have to fill out the form every time.”
David Evans
ICO

Although it’s disappointing that it’s taken until the last minute for this clarification—images of panicking companies rushing around to comply with stringent laws come to mind—I think this is a truly positive move from the ICO. The original guidance, at least to me and I think to many others, showed a gross misunderstanding of the state of cookie use, from a technical perspective. Without even starting on Google Analytics, often used embedded services such as YouTube, AddThis and ShareThis use cookies liberally, and to ask companies to control them is just impossible. I don’t know whether the regulations reflected this all the time, the regulation document was way too long and full of legal speak for anyone other an a lawyer to fully comprehend. Regardless, we can all relieve ourselves of the worry that we might have to get lose most of our Analytics data to no-one clicking that “Accept Cookies” button.

Please do read the new guidance for the best guidance, I’m no lawyer, just taking guidance as provided by the ICO.

Android Building Blocks PSD: Holo Light Theme

The Android Design initiative has gone a long way to creating a united vision for the Android GUI that has been somewhat lacking traditionally. Contained in the Android Design website is a section called Building Blocks which contains an interesting selection of interface elements. However, there’s no usable template provided.

This free PSD only contains the elements shown image the Building Blocks image and can no doubt be expanded but its a good starting point for anyone who’s looking to create some Android ICS mock-ups.

Android ICS will use Roboto as the display font so you’ll want to install that before using the PSD.

Download