database error Unknown column ‘author’ in ‘field list’ for wp_bwg_file_paths
-
I had a similar problem to another post in this forum. That post did not show the solution. I found a solution that works for me and want to share it incase others hit the same problem.
I have not tried to add new photo gallerys or gallery groups for a long time.
When I tried it recently I found that clicking “add photos” did allow me to upload the photos to the wp-content/uploads/photo-gallery folder but they would NOT be shown in the with photo-gallery dialog preventing me from choosing them.
I just found an error in the php log on my server (/var/log/php-fpm/www-error.log) :
[12-Dec-2021 02:14:07 UTC] WordPress database error Unknown column ‘author’ in ‘field list’ for query INSERT INTO
wp_bwg_file_paths
(is_dir
,path
,name
,filename
,type
,thumb
,size
,resolution
,resolution_thumb
,alt
,credit
,aperture
,camera
,caption
,iso
,orientation
,copyright
,tags
,date_modified
,author
) VALUES (‘0’, ‘/’, ‘_DSC9894.jpg’, ‘ DSC9894’, ‘jpg’, ‘thumb/_DSC9894.jpg’, ’82 KB’, ‘1200 x 795 px’, ‘500×331’, ‘ DSC9894’, ”, ‘4.5’, ‘NIKON D7000’, ”, ‘6400’, ‘1’, ”, ”, ‘2021-02-27 16:36:15’, ‘1’) made by do_action(‘wp_ajax_addImages’), WP_Hook->do_action, WP_Hook->apply_filters, BWG->bwg_filemanager_ajax, FilemanagerController->execute, FilemanagerController->display, FilemanagerModel->get_file_lists, FilemanagerModel->files_parsing_dbThe other post suggested that we manually add the ‘author’ column to the table but as with that post I encountered this error:
ERROR 1118 (42000) at line 1: Row size too large. The maximum row size for the used table type, not counting BLOBs, is 8126. This includes storage overhead, check the manual. You have to change some columns to TEXT or BLOBs
I have some knowledge of mysql and this command ‘describe wp_bwg_file_paths;’ shows that it has at least two fields of type mediumtext which probably accounts for the error.
I dumped the table and its structure with:
mysqldump -u root -p mwi_wordpress wp_bwg_file_paths > /tmp/wp_bwg_file_paths.sql
I then made a small change to the create section:
date_modified` datetime DEFAULT NULL,
resolution_thumb
varchar(15) COLLATE utf8mb4_unicode_ci DEFAULT NULL,
author
bigint(20) NOT NULL DEFAULT 1, <<<<<<<<<<<< Added this line
PRIMARY KEY (id
)
) ENGINE=MyISAM AUTO_INCREMENT=206 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
^^^^^^^
Changed from InnoDB to MyISAM`I believe the issue was that the table was InnoDB type which has the limited row length. Changing to MyISAM eliminates that restriction.
YMMV, but I hope this helps someone….I also hope that the maintainers of this plugin put out some sort of schema change that will automagically do this update.
Example:
If wp_bwg_file_paths is InnoDB then drop/add table with MyIASM while maintaining existing data.
- The topic ‘database error Unknown column ‘author’ in ‘field list’ for wp_bwg_file_paths’ is closed to new replies.