Sam's notebook

Uninstalling WordPress plugins in PHPunit March 1st, 2016, 9AM

Programming

There’s a problem with uninstalling Tabulate. Fatal error: Class ‘WordPress\Tabulate\DB\Grants’ not found in C:\work\public_html\wp\stage\wp-content\plugins\tabulate\uninstall.php on line 8 The uninstall.php file shouldn’t know anything about the actual plugin. It shouldn’t use any classes or functions from the plugin itself. This problem should have been caught before now, though, because the tests all run uninstall.php in their […]

[No comments] [Keywords: , , ] [Permanent link]

Loading spatial data into MySQL with LOAD DATA INFILE July 23rd, 2015, 9AM

Programming

Just a note for my future reference: importing an Excel CSV into MySQL. The WKT column has been constructed by hand to be POINT(lng lat) and the CSV contains headers. LOAD DATA INFILE ‘/full_path/to/file-on-server.csv’ REPLACE INTO TABLE the_table COLUMNS TERMINATED BY ‘,’ OPTIONALLY ENCLOSED BY ‘”‘ IGNORE 1 ROWS (name,description,@geographic_location) SET geographic_location = GeomFromText(@geographic_location) ;

[No comments] [Keywords: , , , , , , , , ] [Permanent link]

Including views in Drupal modules December 17th, 2014, 9AM

Programming

Views are included in modules by implementing hook_views_api() and hook_views_default_views() and returning an array of view objects from the latter. The easiest way to construct the view object is to create the desired view via the UI and then export it, saving each exported view into its own function in sites/all/modules/custom/modulename/modulename.views_default.inc and then returning them […]

[No comments] [Keywords: , , , , , ] [Permanent link]

A bug in the Workflow module confuses me November 19th, 2014, 8AM

Programming

I’m getting and annoying error when running reverting a Feature (drush fr featurename): /var/www/stage.example.org$ drush fr featurename Fatal error: __clone method called on non-object in /var/www/stage.example.org/sites/all/modules/workflow/workflow.features.inc on line 55 Drush command terminated abnormally due to an unrecoverable error. Error: __clone method called on non-object in /var/www/stage.example.org/sites/all/modules/workflow/workflow.features.inc, line 55 It looks like this bug was fixed […]

[No comments] [Keywords: , , , , ] [Permanent link]