Jump to content

Search the Community

Showing results for tags 'dev'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


  • Welcome to ProcessWire
    • News & Announcements
    • Showcase
    • Wishlist & Roadmap
  • Community Support
    • Getting Started
    • Tutorials
    • FAQs
    • General Support
    • API & Templates
    • Modules/Plugins
    • Themes and Profiles
    • Multi-Language Support
    • Security
    • Jobs
  • Off Topic
    • Pub
    • Dev Talk

Product Groups

  • Form Builder
  • ProFields
  • ProCache
  • ProMailer
  • Login Register Pro
  • ProDrafts
  • ListerPro
  • ProDevTools
  • Likes
  • Custom Development

Find results in...

Find results that contain...

Date Created

  • Start


Last Updated

  • Start


Filter by number of...


  • Start





Website URL







Found 11 results

  1. Hi Everyone! I feel I'm falling behind and becoming a "dinosaur" with how I work on the web, so in the hope to make myself feel better and hopefully learn from others Please sahre how you usually work on projects and tools you might use. Think: IDEs, servers and hosting, command line tools, PW moduels that help with development etc...
  2. Most of us know and use site/config-dev.php file. If present, it is used instead of site/config.php, so it is easy to set database connection and debug mode for local development, not touching the production config. It is also very useful when working with git. You can simply ignore it in the .gitignore file, so local settings won’t end up in the repo. But sometimes you need to add code to site/ready.php or site/init.php just for the dev environment. For example, to add ryan’s super cool on demand images mirrorer. I can’t live without it when working with big sites, which have more assets then I want to download to my desktop. It would be great if there was something like site/ready-dev.php for this. Not out-of-the-box, but it’s pretty easy to achieve. Unlike site/config-dev.php, site/ready.php is not hardcoded. It’s name is set with a special config setting: // wire/config.php $config->statusFiles = array( 'boot' => '', 'initBefore' => '', 'init' => 'init.php', 'readyBefore' => '', 'ready' => 'ready.php', 'readySite' => '', 'readyAdmin' => '', 'render' => '', 'download' => '', 'finished' => 'finished.php', 'failed' => '', ); As you can see, we can not only define, which files are loaded on init, ready and finished runtime states, but probably even add more if we need to. So we override this setting in site/config-dev.php like this: // site/config-dev.php // Change ready.php to ready-dev.php $temp = $config->statusFiles; $temp['ready'] = 'ready-dev.php'; $config->statusFiles = $temp; For some reason we can’t just do $config->statusFiles['ready'] = 'ready-dev.php'; and have to override the whole array. Maybe you PHP gurus can explain this in the comments. Now we can create the site/ready-dev.php file and place all the dev-only code there. Important thing is to include the main site/ready.php. // site/ready-dev.php include 'ready.php'; // DEV HOOK TO MIRROR ASSETS ON DEMAND $wire->addHookAfter('Pagefile::url, Pagefile::filename', function($event) { $config = $event->wire('config'); $file = $event->return; if($event->method == 'url') { // convert url to disk path $file = $config->paths->root . substr($file, strlen($config->urls->root)); } if(!file_exists($file)) { // download file from source if it doesn't exist here $src = 'https://mysite.com/site/assets/files/'; $url = str_replace($config->paths->files, $src, $file); $http = new WireHttp(); try { $http->download($url, $file); } catch (\Exception $e) { bd($file, "Missing file"); } } }); Do not forget to replace "mysite.com" if you’re copypasting this)) Now, add the newly created file to the `.gitignore` and we’re done. # .gitignore # Ignore dev files site/config-dev.php site/ready-dev.php Thanks for reading!
  3. So I don't know how many have noticed yet, but Youtube has depreciated "rel=0" at the end of the embedded url in September 2018. For some reason, I just noticed today on a site I was working on. If you do not use the rel, you will get related videos across youtube, but if you use it, you will only get related videos from the same channel. Just wanted to share in case people did not know and they needed to make a change on whatever they were working on.
  4. Hello, Another newbie question. My Processwire sites is growing and I'm wondering if my way of doing things sounds goog to you. I tend to avoid what I consider 'heavy and frequent' database requests in my functions. For example : // In functions.php myfunction($player) { wire('$pages')->find("myselectors"); // This means about 300 database requests do something... (like $p->newTmpField = 1;) return $player; } // In template.php $allPlayers = $pages->find("template=player"); // About 300 players foreach ($allPlayers as $p) { myfunction($p); } // Now I have access to newTmpField, for example. I tend to replace with : // In function.php myfunction($allPlayers) { foreach($allPlayers as $p) { // do something like set $p->newTmpField = 1 } return $allPlayers; } // In template.php $allPlayers = $pages->find("template=player"); myfunction($allPlayers); // Now $players have been modified. For example, I have $allPlayer->find("newTmpField=1"); So for the moment, I tend to choose the second solution which makes only 1 database request, but what do more experimented developers would recommend ? What I find useful with Page objects in functons arguments is that I have the whole 'tree' I can then 'find' in my function. But as you can see, I need to understand things better. I have a feeling my 'practical' explanation is not really convincing ? Thanks if someone can take a few minutes to give me advice !
  5. Hi Folks, I am lost and stuck ! I like to setup several domains with ProcessWire - MultiLanguage. All Pages should have the same basisconfiguration and Fieldsets. Its a messy job to setup each domain manually, so my idea was to develop a module , which setup my basis templates + fields + fieldsettings (visuality / dependencies / fieldsets) automatically. But I have no idea how to start and what to start with. All modules I looked at, mostly do something for front-end jobs. But this is an install-module. How to create a module which: create fields and fieldsets and its dependencies (is there a cheatpage for all possibilities ?) create template Pages which implements above fields If someone could give me an easy implementationhint it would be sooooo nice. Maybe there is already something I could look at for learning. Thanks a lot Michael -- Using PW 3.0.62
  6. I hid/set aside the old /wire/, index.php, and .htaccess, as well as /site/config.php. Debug=1. $config->urls->admin = /pw/, as it's set as. I'm finding that others are encountering a similar issue but haven't found any solution yet, at least none that works for me. Please help, thanks much
  7. Hi, the AdminThemeReno has mysteriously disappeared from the admin. it is in the wire modules, and the database modules table, but absent from the modules listing.. it has basically vanished; I tried updating to the latest dev to see if that would fix it. The problem seems to have started when i went into Modules Manager and the version was older so there was a json error; then right after reloading the page, the theme flipped back to the regular theme, and then the reno disappeared..; i'm not completely sure if modules manager was the source of the issue; I'm guessing some database corruption? not sure where to start troubleshooting this, but would really appreciate any help or advice. What do most people do when you hit a 'dead-end' issue like this? Is there some way to check the database for some misconfiguration? Should i delete the modules entry in the DB? not sure if this is related, but if i uninstall the default theme, i get this error: Modules: Module 'AdminThemeReno' dependency not fulfilled for: AdminThemeDefault and also if i try to place the default admin theme module into the /site/modules/ then i flip back to the legacy admin, and there is an error asking which one, but if you click on that and go to the module settings, there actually isn't any option to specify which folder to use; it ends up using the site version.. also getting strange errors... [14-Feb-2015 19:46:11 America/New_York] PHP Notice: Trying to get property of non-object in /home/someuser/dev/site/modules/ModulesManager/ModulesManager.module on line 820 [14-Feb-2015 19:46:32 America/New_York] PHP Notice: Undefined offset: 0 in /home/someuser/dev/site/modules/ProcessDiagnostics/DiagnoseModules.module on line 43 [14-Feb-2015 20:12:27 America/New_York] PHP Notice: Undefined index: AdminThemeDefault in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 284 [14-Feb-2015 20:12:27 America/New_York] PHP Notice: Undefined index: AdminThemeDefault in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 287 [14-Feb-2015 20:12:27 America/New_York] PHP Notice: Undefined index: flags in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 287 [14-Feb-2015 20:14:48 America/New_York] PHP Notice: Undefined index: AdminThemeDefault in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 284 [14-Feb-2015 20:14:48 America/New_York] PHP Notice: Undefined index: AdminThemeDefault in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 287 [14-Feb-2015 20:14:48 America/New_York] PHP Notice: Undefined index: flags in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 287 [14-Feb-2015 20:15:12 America/New_York] PHP Notice: Undefined index: AdminThemeDefault in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 284 [14-Feb-2015 20:15:12 America/New_York] PHP Notice: Undefined index: AdminThemeDefault in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 287 [14-Feb-2015 20:15:12 America/New_York] PHP Notice: Undefined index: flags in /home/someuser/dev/wire/core/ModulesDuplicates.php on line 287 thanks!
  8. Hi all! I hope somebody could help me to figure out this weird issue I've found. Few days ago I've upgraded my local installation to the latest dev release (2.6.20 -> 2.6.22 rc1) and performed some tests to be sure everything was working as expected. No problem at all. After these tests, I decided to do the upgrade to the remote installation, too. Here the problems came. The upgrade was done without any issue or error message. Everything was ok, but permissions don't work as expected. I've an author role with limited editing permissions (page-add/create for children pages, and page-edit-created) that works as expected on local installation, but doesn't works at all on remote installation. Only page-view permission is still available for some pages. Some pages expected to be editable, now don't have any permission available (neither the page-view permission), even whether I remove any kind of access control, PW still complains that the role hasn't the required permission for adding or editing. Any help is really welcome. Thx!
  9. I'm testing out the new user-admin permissions feature of dev 2.6.10 I followed this blog post http://processwire.com/blog/posts/new-user-admin-permissions-automatic-version-change-detection-and-more-2.6.10/#new-managed-module-versions-by-the-core to create two permissions user-admin-all user-admin-members-manager But, I could not find the new permission in user roles setting page
  10. Mats

    Poll site

    Today Kalmar County Museum released a small campaign site where people can vote for their favorite building in the city of Kalmar (Sweden). The site uses latest PW dev version and Somas excellent Pollino module. The maps are powered by Leaflet and map tiles are from Mapbox. http://kvarnholmen.kalmarlansmuseum.se/
  11. I have searched the forums and PW documentation and can't find anything on this topic. Is there a config someone has implemented for using PW in multiple environments? I'm using Git with DeployHQ to deploy changes and would like a config that will detect which environment the site is on thusly loading the appropriate DB details.
  • Create New...