Jump to content

horst

PW-Moderators
  • Posts

    4,088
  • Joined

  • Last visited

  • Days Won

    88

Everything posted by horst

  1. Repeaters (can) create pages before you need them. This is for convenience. The default value is set to 3. You also can setup a repeater field to only create pages on demand. If I remember right, this would need one additional save click for every repeater item you add in the edit process. 1) check delete trash 2) set the repeater fields to NOT create temp pages, the default is set to 3 (!) 3) look under Admin -> Pages -> ... for a hidden folder with the repeater children and delete them
  2. Thanks Raymond. Have updated it in the code example above.
  3. I found wireTempDir myself a few days ago, so memory fingerprint was fresh.
  4. $tmpDir = new WireTempDir('someName'); // add files $fileBasename = 'basename.ext'; $filename = $tmpDir->get() . $fileBasename; file_put_contents($filename, base64_decode($b64Data)); $page->files->add($filename); // repeat for all files ... // optionally, at the end call $tmpDir->removeAll(); EDIT: Ah, you already know / found WireTempdir() EDIT2: If one use WireTempDir for very timeconsuming tasks, one optionally can define a maxAge for it, different than the default 120 seconds: $tmpDir = new WireTempDir('someName', array('maxAge' => 300));
  5. Yes, best way would be only to dynamically change all date reading, but not to alter date writing.
  6. The meaning is, that, if there isn't explicitly set a value, the return would be NULL (blank field) and not the integer 0.
  7. I'm not very familiar with (user) timezones. A quick search through PWs wire files shows that timezone is used in ProcessWire::config with ini_set('date.timezone', $config->timezone); So I would change $config->timezone and PHPs date.timezone. But haven't worked / tested with that! In regard of getting the original / default value and not a runtime-changed value from $config, there is this possible workaround: function getDefaultValuefromConfig($key) { $config = new stdClass(); include( wire-config.php ); include( site-config.php ); // now we have merged default settings of $config in local scope of this function // and can return the requested one return $config->$key; }
  8. Because it depends on login / logout, my first thought is: $this->pages->addHookAfter('Session::logout', $this, 'yourFunction'); $this->pages->addHookAfter('Session::login', $this, 'yourFunction'); If this doesn't fit well, there is also $this->pages->addHookBefore('ProcessLogin::execute', $this, 'yourFunction'); $this->pages->addHookBefore('ProcessLogin::executeLogout', $this, 'yourFunction'); // or $this->pages->addHookAfter('ProcessLogin::execute', $this, 'yourFunction'); $this->pages->addHookAfter('ProcessLogin::executeLogout', $this, 'yourFunction');
  9. What's about not yet saved content in other fields when reloading? Will this get saved first? Also, is it good to save (optionally massive) changes without the knowing of the user? At least, I think it only could be an option, not the default.
  10. Hahaha! (That's funny)
  11. There is also an example layer class on SO that provides none blocking concurent session writes: http://stackoverflow.com/questions/10046570/php-save-session-when-using-session-write-close/27993746#27993746 But you need to implement this yourself before you start the long running tasks and switch back to PWs regular behave after you have finished them. You can use everything you want to handle sessions with http://php.net/manual/en/function.session-set-save-handler.php.
  12. Hi @jon9china, hhm, yes, sorry. The httpHosts array needs to be changed to (at least) include the new hostname too. (Or is set to only hold this domain name). It is for security reasons, but this isn't the reason for the 500. Regarding the 500 internal error: You need to check write permissions for folders and files under site/assets/. (Including the assets folder itself.) PW needs write access to create / delete subfolders and files. During installation you have defined chmod values for files and folders for that, it is noted in your site/config file. (e.g. 0755 and 0644, or 0777 and 0666). Check if files and folders in the subdomain are assigned that way. Also, if the 500 is gone and you can access the admin but get some errors there, you should go to -> modules -> refresh (search for new). PW uses cached informations for all modules (installed and uninstalled ones), including pathes. This needs to be recreated, too, if it isn't automatically. Please report back when all is working ok, or if there is anything other that doesn't fit. PS: here is little troubleshooting guide from Nico, regarding regular installation processes: Doesn't fit in your case, as your orig site is already running, but maybe is nice to have bookmarked for future installations on (foreign) hosts.(?)
  13. In short: nearly nothing more! If you have an exact copy of your origin Database as second DB you only need to change the credentials in site/config.php to point to the dev-DB. Besides that, you should copy the index.php, .htaccess and complete wire and site folders to the dev.domain. That's it!
  14. Another approach can be to setup a dev-subdomain on your online hosting provider and use an editor that provides editing of those files directly via ftp(, sftp, ftpes) behind the scenes. This has been discussed sometimes here in the forums too. Good google searches for that can be: site:processwire.com/talk -"Viewing Profile" mac editor ftp It depends on your hosting account, if there are resources for: 1 additional DB and the possibility to create subdomains, e.g. a dev.example.com besides the www.example.com.
  15. @LostKobrakai: thanks for the link and clarification! @rick: hmm, yes, - I forgot to mention that I'm old-schooled.
  16. It would have been nice if you have pointed to the relevant slides of matrix. Or do you really believe people want to look 1 hour video to be able to understand your question? So, cannot say much to matrix, but a few things came to my mind: I use split screen since ever, via two browser windows! Have a look to the blueVR siteprofile. It seems to handle output positioning of parts very nicely. Don't know if this is something in regard of the (for me) unknown matrix, but, maybe it gives you another point of view.
  17. @pwired: You should have a look to the SPEX module, it has all what you are looking for onboard allready.
  18. One more Button, for: OpCache status If OpCache is enabled on a site, it includes a new button and add an admin page for viewing the opcache status. The script for showing this is taken from, and credits go to: Rasmus Lerdorfs. See github repo: https://github.com/rlerdorf/opcache-status
  19. @Pierre-Luc, if possible, you should update the compatibilty list of that module, - it only shows PW 2.4. All your other modules are up to date in this regard and shows versions inkl. PW 2.7
  20. Hi Henrik, I'm not sure and in a hurry, but regarding 1), it can have to do with outputformating state. Please try and compare both possibilities explicitly set: $nlPage = $wire->pages->get("/newsletter/"); $newText_with_outputformatting = $nlPage->of(true)->text_without_p_tags; $newText_without_outputformatting = $nlPage->of(false)->text_without_p_tags; My guess is, that without setting it to true, in bootstraped mode it is set to false, = unformatted. This way no textformatter is supplied. Whereas the Template-Scope is the only scope where outputformatting is set to true automatically. Everywhere else, you have to explicitly check or set it. Regarding 2: you can define what you want to have as result, array or singleimage i the settings (advanced settings?) of the image field. But this also is only supplied if the outputformatting is ON. If you are in bootstrap mode, and access to it, you get unformatted return, what always is an array for all fields that can handle multiple items. Please refer to the docs for multiples and outputformatting to get more information. Once you have read it, you will get how it works, and that it all makes sense.
  21. A bit offTopic, but since a few weeks I know that there is this module to Backup DBs. So, I don't want scheduled Backups for Sites that in development state, but I want to have many backups in little steps. Therefore I added this to my ready.php after I installed kixes module: $wire->addHookBefore("Session::logout", function(HookEvent $event) { if(!wire('modules')->isInstalled('CronjobDatabaseBackup')) return; if(!wire('user')->hasPermission('db-backup')) return; // execute a cronBackup $cdb = wire('modules')->get('CronjobDatabaseBackup'); $e = new HookEvent(); $cdb->cronBackup($e); return; }); I setup the module CronjobDatabaseBackup with: BackupCycleInterval = never; a high number of Maximum Number of Backupfiles; and a name format with timestamp, like: #__%Y-m-d_H-i% This way, everytime when a defined user logs out, a backup is made.
  22. Don't really understand the second part. What I would say is: it doesn't make sense if the children of a Fieldset (what is a wrapper or a parent container) doesn't inherit the parents state. (<- does this make sense?) (Sometimes it isn't easy if two none native english people talk / write in english)
  23. You can securely drop all rows from table caches. They will be recreated on next request. Please tell if this changes the behave or not.
  24. I vote for "bug"! IMO this doesn't make sense.
  25. Is this the only superuser you have, or do you have multiple superusers?
×
×
  • Create New...