#1
Hi, trying to download the Simple Blog Module from the Module Market.

I am an error message 'A JavaScript error occurred in the main process' and pointing to an TypeError: Cannot read property ' foreach' etc etc etc. I have a pic of the error message if needed.

I have loaded another module 'data tabs' and this works fine.
#2
Hi John,

Is this for a new app or existing?

The screen shot would be helpful too.

Update:
No need for screen shot or answering question, just tried it myself and think there is an issue with either desktop app or the module. Will try just downloading it directly and see what's going on. So in short, it's not you.

Errror occuring in file_manager.js on line 387:17 at go$readdir$cb
#3
Hi

yes - same error that I am getting.
#4
Ah the problem is that the Desktop app doesn't know how to deal with the file structure of this 'app' as it is not just a single module but a group of many modules (blog_categories, blog_notices, Module_relations, my_filezone , notice_sources and pictures), along with a pictures and public directories.

At the moment the only way to install this app - I wouldn't call it a module. Is to download it as a zip, then unpack it into a freshly created Trongate app, until DC updates the Desktop app to recognise and deal with the install. If you look in your modules folder of the app you installed it to, you will find a folder called 'blog'. In there will be all the folders and files unzipped, but in the wrong locations. Just move them up into the root of your app and it will work.
#5
The javascript error occurs because of the folder structure of the app.

The problem with the blog module is the file structure.
It should be set up as a module/sub-module, with an assets folder to hold the images.
Then all the sql files should be on the main root.

Below is how I would structure it to work on the module market
First, I have not included all what is in the assets and view folders, just module folders and controller folders.
Second, I would put all the public folders in the blog_notices/assets folder
Third, Notice at the bottom, only the two .sql files and the main blog folder are on the main root.
Fourth, Not sure what the desktop.ini file is for. But for the MM it should not be on the root.
Lastly, If you structure the Blog app like this you would have to adjust all the links.

My reasoning for this is makes the blog app totally portable and self contained.

blog
--assets
--controller
-----Blog.php
--views
--blog_categories
------assets
------controllers
---------Blog_categories.php
---------views
--blog_notices
------assets
------controllers
---------Blog_notices.php
---------views
--module_relations
------assets
------controllers
---------Module_relations.php
---------views
--my_filezone
------assets
------controllers
---------My_filezone.php
---------views
--notice_sources
------assets
------controllers
---------Notice_sources.php
---------views
--pictures
------assets
------controllers
---------Pictures.php
---------views
blog.sql
pictures.sql
#6
Hi,

I haven't checked it out but if it's causing issues then I think we should take it off of the module market until the author has had a chance to sort it out.

Does that seem reasonable?
#7
Hi,

so I have this working now by restructuring the files as recommended above.

I then imported the sql files.

I hope the author sorts this out, because it is essentially a good piece of work. The code is reasonably well organised and structured and can help recipients to build on it to create worthy applications.
#8
DC, you could just add a check_module_structure() to the trongate.io API or Desktop app that suggests to download the zip instead? Up to you. Or add the feature to unpack into the root of the app, but overwriting an existing app could be disastrous.

Or a quick fix could be to add an option for complex 'full apps' in the upload process to flag out the Desktop app install, and only download from the website... Like a pop up in the desktop app saying - file structure too complex - install manually, then force the author to write detailed install docs.