elkuku / EasyCreator

EasyCreator helps creating extensions for the Joomla! CMS
http://extensions.joomla.org/extensions/miscellaneous/development/5908
50 stars 23 forks source link

Problem reading empty sql file #25

Open doorknob2 opened 10 years ago

doorknob2 commented 10 years ago

I loaded an existing (third party) component and clicked the 'DataDesigner' button. The process reads the sql update files in the component/sql/updates directory. There were about 40 files, about 25% of which were empty files. On reading an empty files, the process terminated with an error message: File read error. I made two changes. The first was to update the message to include the name of the offending file and the second to allow empty files to be processed. I changed helpers/table/helper.php (v0.0.21) lines 95-100 from if( ! $fContents = JFile::read($file)) { EcrHtml::message('File read error', 'error');

                return $tables;
            }

to $fContents = JFile::read($file); if( !is_string($fContents)) { EcrHtml::message('File read error: '.$file, 'error');

                return $tables;
            }
elkuku commented 10 years ago

This looks quite interesting. Any chance you could craft a Pull Request for this? This would also assure that you will receive full credits for your work. Would be awesome :wink:

That said, the "Data Designer" is heavy work in progress and sadly I didn't found the time to make it work properly (yet) Any help would be greatly appreciated.