• Content count

  • Joined

  • Last visited

Community Reputation

127 Excellent

About FrancisChung

  • Rank
    Sr. Member

Profile Information

  • Gender
  • Location

Recent Profile Visitors

1,866 profile views
  1. I discovered an error with the config.php file in the following line $config->chmodDir = '0755'; // permission for directories created by ProcessWire It was set to '0' not '0755'. Alas, it wasn't the cause of my issue ... I've narrowed it down to it being something in the backend database. If I point the (not working) codebase to an older database, it seems to load up. Unfortunately, I've tried to compare the database dump scripts between the 2 databases and I can't make heads & tails sense out of it. Anyone has any suggestions for comparing 2 databases? Some custom code?
  2. @gebeer: I've managed to eliminate all errors that were displaying in the KIS Error logs. And the page still won't load ... At this point, the only thing left is to use the working site as a base and try updating its codebase + data and hope for the best.
  3. @gebeer, I've checked the folders and they all have the same directory owner/group settings. I would imagine if there was a problem on the directory level, I would be seeing this issue all over the place and not a couple of specific pages. I've also spotted some bugs in the last 15minutes and have eliminated them so the only issues I see now are the permission issue(s) with the image files. I'm going to add some extra debugging, error handling to see if I can shed any more light into it.
  4. Hi @gebeer, thanks for the response. To answer your questions : 1) The owner / group of all the image files are the same. They belong to the owner / group name that bears the account name. 2) The files are definitely all there. I haven't checked all of them but I've spot checked about a dozen and they are there as expected. 3) Looks like I already have code file_exists check in SquareImage.php, albeit I'm checking for the full path, not the path that starts with /site/template ... Is there a PW API call that does a file check that takes in a path name that starts with /site/templates .... ?
  5. Hi PW Community, I have a problem where a page is loading up fine on my local dev machine + 1 of the test sites, but not on another test site. They have identical PW (2.8.35?) and codebase installed. The 2 sites are hosted on the same hosting provider, as well as our other sites. 1) Error Logs. There is nothing particularly strange logged on the PW Error log for all the sites. I am getting a "You must assign a template to the page before setting custom field values (title__data) [pageClass=Page, template=] (WireLog)" error, but I'm getting this error on working pages as well. However, there are some errors in our Hosting Provider's log. The error seems to point at some sort of permissioning issue regarding reading the image files? 1.a) File / Dir permissions of Images - I've checked file permissions on the normal and problematic sites. They are all identical 2) .htaccess - I've tried running the .htaccess file from the working site on the problematic site - No Luck 3) codebase - I've done 3 comparisons. They are identical on all sites. 4) wire directory - See above 5) Behaviour - So the problematic site loads up most of its page as expected without problems. It's just a couple that it has issues with. Problematic URL Example : Working URL : I've also attached the KIS Error Logs. Has anyone come across behaviour like this before and what would be the way forward to fix this? KIS.Error.Logs
  6. Does it have to be CSV? I've recently migrated to a XML based export functionality because of the limitations of the CSV format.
  7. @Sérgio, you post made me think that it would be really great if there was a website where you answered some (or many?) multiple questions about your project and it would recommend a combo of frameworks based on your answers, as well as some alternatives. Of course, it may not be the best combination in all scenarios but it would save you a ton of time researching or thinking about it. And of course, Processwire would always be the recommended CMS of choice hehe.
  8. If you look at the manual setup steps of Foundation, you'll see they ask you to install bower. So I assume it must be part of the Auto setup somewhere not visible to the user. For reference, I have my bower_components folder under the templates folder. Perhaps, you should just leave alone the folders as eventually you'll have to update components over time and unless you want to tinker with extra steps during the update process best just to leave it as it is.
  9. Wow quick reply! If only Guetzil was as speedy and compact like your response, @AndZyk That post was ace. Thanks.
  10. Just realised most of PW tables are MyISAM so the -single-transaction flag is kinda useless absolutely futureproof.
  11. Out of interest, how much would the TinyJPG compressed image be ?
  12. @szabesz @pwired : Sorry for the late response. Been very busy with a deadline that inevitably dragged on and on ... For those who are interested, I've got the following for automating my deployment. By all means, it's not perfect nor is it complete but it does the job with a minimal investment of my time. I have structured my DB scripts into 2 categories. The dump_<xxx> scripts and the restore_<yyy2zzz> scripts. The dump scripts are to dump the DB contents as a whole where <xxx> signifies an identifier to the DB you're dumping (e.g. Dev, UAT, Live etc). So my script looks like #!/bin/bash _now=$(date +"%Y%m%d") _file="../dumps/Dump$_now-LOCAL.sql" echo "Starting Dump to $_file..." /Applications/MAMP/Library/bin/mysqldump -h localhost -P 8889 -u root -p'PasswordHereWithTheQuotes' --single-transaction [DBNAME] "$_file" echo "Dump to $_file finished" Key things to note here is : 1) 1st line of code generates a datestamp 2) It then creates a path of the dump file in the dump folder 3) Then it calls MySQLDump using the predefined parameters. Obviously this is for my local installation, so for a server dump file you'll want to change the dump suffix (from LOCAL to DEV,UAT,LIVE or whatever), the hostname, user, password, port (which will be different to 8889 most likely. Mine is 3306 on our service provider) and DBName. If you;re wondering what the single transaction flag is ... The restore files are similar except for my scripts, I've chosen to do a specific one for each XXX2YYY variation. Not the most efficient, but I'm not a bash script ninja either. XXX being Source, YYY being destination in case your'e wondering. So my looks like : #!/bin/bash _now=$(date +"%Y%m%d") _file="../Dumps/Dump$_now-LOCAL.sql" echo "Starting restoring from $_file to dev ..." /Applications/MAMP/Library/bin/mysql -h [HostDBServerAddress] -P [HostDBServerPort] -u [HostDBUserLogin] -p'[HostDBUserPwdInSingleQuotes]' [HostDBName] < "$_file" echo "Restoring from $_file to dev finished" Notes : 1) I'm using mysql instead of mysqldump here 2) I'm assuming you already created a dump today of the DB file you're uploading (line 2 & 3) 3) There's a bit more involved here with the parameters but I hope the long descriptive labels are self explanatory. Feel free to contact me on this forum if you're unsure. By all means these should cover the basics that you need. Things to improve upon are obviously in the security side of things. There's -ssl options and SSL certificate options that I haven't looked in at detail. If anyone is using them and willing to give us a quick primer ....
  13. I <3 PW but I'm definitely not in love with PHP
  14. I just wanted to update saying the module doesn't work. The problem is that the actual PHP module it depends on, mobiledetect.php is using $_SERVER['HTTP_USER_AGENT'] which is an outdated way of detecting devices from the server. It failed on Safari where it couldn't distinguish whether you were using it from the Desktop or a mobile device. (You could argue PHP is probably not the way to go, compared to JS but that's another post ) I must have tried every PHP based solution out there in the last couple of weeks. The only thing that has worked for me is UserAgentInfo. I'm posting an example here, in case some one wants to update this module function IsMobile() { $ua = UserAgentInfoPeer::getMy(); $mobile = $ua->isMobile(); return $mobile; } P/S You will need to add a reference to this class (You may need to change the path to suit your code structure) require_once(__DIR__.'/../vendor/UserAgentInfo/UserAgentInfoPeer.class.php'); and then you may need to configure UserAgentInfoConfig class if the caching mechanism (Redis by default) is not what you want. Just change the CACHE_CLASS_NAME to the class you want. //const CACHE_CLASS_NAME = 'UaiCachePhpredis'; //Not installed locally //const CACHE_CLASS_NAME = 'UaiCacheMemcached'; //Not installed on Provider //const CACHE_CLASS_NAME = 'UaiCacheAPC'; //Not installed on Provider const CACHE_CLASS_NAME = 'UaiCacheDebug'; FYI I had to go for the non cached version (UaiCacheDebug) because of the hosting solution we currently have (i.e. el cheapo solution)
  15. I have some automated scripts that dump the whole database into a file and uploads that to a dbserver and db of choice. I use this to do my deployments for testing and going live. I normally don't touch config.php unless there's been a version upgrade of PW. Let me know if you're interested and I can post it here.