Using install-concrete5.php and standard Starting Point ccm:file:export files seem to be missing

Permalink
Initially I was trying to figure out why my Themes didn't have any header images after installation ( some say 'Image not found' others were just empty ).

I looked in the /concrete/config/install/packages/standard/content.xml and found that they should probably be coming in via {ccm:export:file:...} declarations.

There seem to be no records in the DB either... SELECT * FROM Files; returns no records.

I'm using concretet5.5.2.1

I'm glad to help debug this further but could use some pointers.

Thanks,

Wes

wcravens
 
wcravens replied on at Permalink Best Answer Reply
wcravens
It would seem that this problem is rooted in the fact that DIRECTORY_PERMISSIONS_MODE is not set in concrete/helpers/concrete/file.php.

I don't think that this is an elegant fix but it does fix the problem... so maybe it's a clue to someone who knows better:

diff --git a/lib/c5/concrete5.5.2.1/concrete/helpers/concrete/file.php b/lib/c5/concrete5.5.2.1/concrete/helpers/concrete/file.php
index ab5460a..9b0bf69 100644
--- a/lib/c5/concrete5.5.2.1/concrete/helpers/concrete/file.php
+++ b/lib/c5/concrete5.5.2.1/concrete/helpers/concrete/file.php
@@ -90,6 +90,14 @@
                                $d1 = substr($prefix, 0, 4);
                                $d2 = substr($prefix, 4, 4);
                                $d3 = substr($prefix, 8);
+        if (!defined('DIRECTORY_PERMISSIONS_MODE')) {
+          $perm = Loader::helper('file')->getCreateFilePermissions()->dir;
+          if($perm) {
+            define('DIRECTORY_PERMISSIONS_MODE', $perm);
+          } else {
+            define('DIRECTORY_PERMISSIONS_MODE', 0775);
+          }


It's worth also reporting that because I use a file/dir structure skeleton for my new installations... my current solution is to cp concrete/helpers/concrete/file.php with the above diff to my site skeleton and rename the class to SiteConcreteFileHelper.

I was pleased that this 'just worked'. Thanks concrete5 for making this sensible. :-)

Wes