Since I really don't know a whole lot about this stuff I thought I would take it back to basics! I cloned the Ubuntu workstation I was using for my live site so that everything was the same. I used Composer to install a project named TEST using the most current stable version of Silverstripe, then fixed permissions, confirmed mod_rewrite, etc. I had tried to use Composer to install modules and update dependencies in the past, but it didn't seem to work. When you install a new project using Composer you specify the path to where you want it installed. Whenever I was running Composer I was running it from my home directory and always wondering "How does Composer know which project I want the modules installed too!?". Well, figured that one out! For those that don't know, you run it from your project root. (ie. Open terminal and change your working path to /var/www/ProjectName, then run composer). The modules appear in your project root and when your run /dev/build it will actually do something! The other thing that I noticed is that after installing content-blocks to my TEST project using composer I didn't have to mess with changing any "private" to "public". I had originally been trying to install the content-blocks module by copying the folders to "mysite", then running /dev/build. So after installing content-blocks using composer to a fresh install of silverstripe I tried to do what I couldn't before and was amazed to find that everything was working as it should!
So I went to the live site, pulled all the modules out, ran /dev/build, and then tried to install content-blocks using composer. Composer died. Composer.json file hadn't been updated in quite some time obviously! Made a correction to the required version and tried installing content-blocks with Composer again. My blog module and a number of other modules got updated as well and things stopped working for a bit. After making some "private" to "public" corrections in my Blog module I got everything functional again.
When I went to test the "Add" button from the "Block" tab this time I got an error.
[12-Mar-2015 16:18:17] Error at framework/model/MySQLDatabase.php line 598: Couldn't run query:
SELECT DISTINCT "Block"."ID", "SortOrder"
FROM "Block"
INNER JOIN "Page_Blocks" ON "Page_Blocks"."BlockID" = "Block"."ID"
WHERE ("Page_Blocks"."PageID" = '159')
ORDER BY "SortOrder" ASC
LIMIT 2147483647
Column 'SortOrder' in field list is ambiguous (http://norcalscans.org/admin/pages/edit/EditForm/field/Blocks/add-multi-class/Block)
[12-Mar-2015 16:19:34] Error at framework/model/MySQLDatabase.php line 598: Couldn't run query:
SELECT DISTINCT "Block"."ID", "SortOrder"
FROM "Block"
INNER JOIN "Page_Blocks" ON "Page_Blocks"."BlockID" = "Block"."ID"
WHERE ("Page_Blocks"."PageID" = '159')
ORDER BY "SortOrder" ASC
LIMIT 2147483647
With my very limited knowledge of PHP and Silverstripe I was thinking another "private" to "public" issue. Tried investigating further but was running into a wall again and figured I could just move my database information over to the working TEST project and call it good. Exported my LIVE DB and attempted to import into my TEST project. Error. Then I realized you need a blank DB to import the data into and got this part fixed. With my LIVE DB imported into the TEST project I thought I was good to go after updating styles, header, footer, etc. but when I tried to "Add" a block from the "Block" tab I got the same error. Problem not solved! :-(
So I'm in PHPMyAdmin looking around. Looking at my live DB, looking at my TEST DB. Checking the number of rows in use, etc. Looking for similarities and differences in the one that works and the one that doesn't. While I have tested both neither have any saved blocks. I noticed that the Table named "Block_Images" had a few extra rows in use than the one in my TEST project. I took a look at the rows in use and I notice that there is an ID that is in use more than once. It didn't really seem to fit with what I was seeing in the other that was working.
With that in mind I decided I would remove the content-block module, remove the 3 tables named "block_*" and then reinstall with Composer. After running /dev/build the tables were re-created and BOOM! All working now!
NoBrainerWeb Content-Blocks wasn't the only content-block module I tried to get going. I tried 3, failing miserably each time. My guess is that one of the other content-block modules wrote something to the DB corrupting it at some point.
Now I have other questions/issues about linking the blocks, setting a border that I will address in another post!