Google Share Button Does Not Validate – Not Valid HTML

So you have run your site through the Nu Html Checker  and everything is tickity-boo except the Google share button.  Bah! You get an error that looks like this:

The text content of element script was not in the required format: Expected space, tab, newline, or slash but found { instead.

If, like me, you wanted to change the language of the share button and ended up with some code that looks like this:

<script src=”https://apis.google.com/js/platform.js” async defer>{lang: ‘en-US’}</script>

…then this will be where the problem lies.  Here is why and how to fix it.

Continue reading Google Share Button Does Not Validate – Not Valid HTML

Magento: Programmatically added products do not appear in store until you load and save them in admin.

Ok, so you have written an import script to add a whole load of products into a store but they just don’t show on the front end.  There they are in the admin but not on the front end.  Here is one possible cause. Continue reading Magento: Programmatically added products do not appear in store until you load and save them in admin.

Magento Error: Integrity constraint violation: 1062 Duplicate entry ‘123456’ for key ‘PRIMARY’

Following a database export/import as part of a migration  or copy to a new development environment some database problems can occur, even if the entire db is copied.  Sometimes the problem can be the log files references, as is likely with the error:

Integrity constraint violation: 1062 Duplicate entry  ‘123456’ for key ‘PRIMARY’

Where 123456 is some number.
Continue reading Magento Error: Integrity constraint violation: 1062 Duplicate entry ‘123456’ for key ‘PRIMARY’

Mysql: Export entire database via command line (and import it again)

Sometimes, when migrating servers or copying data to a development environment for example, one needs to take a copy of an entire mysql database. Here is how you do this via the command line on a redhat/centos server:

Continue reading Mysql: Export entire database via command line (and import it again)