Jump to content

Can

Members
  • Posts

    350
  • Joined

  • Last visited

Everything posted by Can

  1. Can

    Deployer recipe

    Okay I figured it's probably my fault but couldn't try it until today.. So @Ivan Gretsky's recipe is working fine..some might already know, but for the shared files/dirs to work you need to set up the correct file structure within shared directory, so you're shared folder needs to look like this -shared -site -assets -config.php
  2. Maybe some javascript messages could work or you add a query string like ?comment=success which shows the message? nice addition, I'll look into it as soon as possible @kixe, think I need your help. I'm standing on the hose about your suggestions.. I replace the "cookie path" config input with an page select like used on "privacy page" right? Then I'm getting an id. But I can't use that id as $path in setcookie or am I missing something? So I would then find the page by this id, and store the page path? But then how to be "multilanguage compatible"?
  3. Thanks for mentioning Yannick, I guess you're right, I tried this before but I guess because of the caching issue it didn't work, so now I can try the shorter version again seems to work, thanks @Yannick Albert
  4. Fixed by Ryan https://github.com/processwire/processwire-issues/issues/59
  5. okay so you're that kind of guy..good to know.. haha..
  6. https://github.com/CanRau/MarkupCookieConsent/ is already doing this and Ryan fixed some missing parts some month ago..
  7. made a note in issue tracker https://github.com/processwire/processwire-issues/issues/59
  8. Thanks to you it works now this time I explicitly set tables to backup for both while disabling caching like so $backup = new WireDatabaseBackup($backupPath); $backup->setWire($wire); $backup->setDatabase($database); $backup->setDatabaseConfig($config); $backupFile = $backup->backup(['description' => 'saludos your Cron', 'tables' => $backup->getAllTables(false, false)]); if ($backupFile) { wireZipFile("$backupFile.zip", $backupFile); exec("ln -sf $backupFile.zip {$backupPath}newest.sql"); $log->message("linked $backupFile"); unlink($backupFile); } $backupMeta = new WireDatabaseBackup($backupPath); $backupMeta->setWire($meta); $backupMeta->setDatabase($meta->database); $backupMeta->setDatabaseConfig($meta->config); $backupMetaFile = $backupMeta->backup(['description' => 'saludos your Cron', 'tables' => $backupMeta->getAllTables(false, false)]); if ($backupMetaFile) { wireZipFile("$backupMetaFile.zip", $backupMetaFile); exec("ln -sf $backupMetaFile.zip {$backupPath}newestMeta.sql"); $log->message("linked $backupMetaFile"); unlink($backupMetaFile); } I saw this caching but didn't really noticed it's turned on by default and might be responsible..
  9. I would say depends on your skills and preference. You could code all the logic right into your template files that's how I started, and still start some things until I figure the task get's more complicated and needs to be in a function or own class/module stuffing all in template files feels faster in the beginning but can be a little harder to maintain depending on the complexity Another thought, if you plan to trigger certain tasks from one point or can easily direct to one location (like setting all form action to one page) just put everything in templates otherwise, or if there is enough evidence that you might add calls from other places, then maybe better split tasks in classes I wouldn't put to many things in one module, for me it always got messy, so if you choose the modular way put mailchimp and freshbooks each in one module and maybe the user stuff in a separate and maybe split even user tasks in different modules if it makes sense you could even create a new page type e.g. "member" https://processwire.com/docs/tutorials/using-custom-page-types-in-processwire/ I don't think there are existing modules, that's because the tasks are fairly basic (create user, add role, remove user etc) and mailchimp/freshbooks depend on their own api's.. If you got more questions on this let us know
  10. What am I mixing up that this won't work, or better to say will throw "..Base table or view not found..." $meta = new ProcessWire($config->paths->root . 'site-meta/', "http://meta.$config->domain"); $backupPath = $config->paths->assets . 'backups/database/'; $backup = new WireDatabaseBackup($backupPath); $backup->setWire($wire); $backup->setDatabase($database); $backup->setDatabaseConfig($config); $backupFile = $backup->backup(['description' => 'saludos your Cron']); if ($backupFile) { wireZipFile("$backupFile.zip", $backupFile); exec("ln -sf $backupFile.zip {$backupPath}newest.sql"); $log->message("linked $backupFile"); unlink($backupFile); } $backupMeta = new WireDatabaseBackup($backupPath); $backupMeta->setWire($meta); $backupMeta->setDatabase($meta->database); $backupMeta->setDatabaseConfig($meta->config); $backupMetaFile = $backupMeta->backup(['description' => 'saludos your Cron']); if ($backupMetaFile) { wireZipFile("$backupMetaFile.zip", $backupMetaFile); exec("ln -sf $backupMetaFile.zip {$backupPath}newestMeta.sql"); $log->message("linked $backupMetaFile"); unlink($backupMetaFile); } if I comment one of them out they'll work properly if I'm trying to run both as in the snippet above the second one fails after the first tables with the above error indicating meta.field_date is missing but this field is only present in the above installation (so the "host" processwire) even tried to explicitly set the tables to backup for the second on with no difference $backupMetaFile = $backupMeta->backup(['description' => 'saludos your Cron', 'tables' => $backupMeta->getAllTables()]); var_dumping $backupMeta->getAllTables() will show the correct tables, meaning there is no reference to field_date tried to instantiate WireDatabaseBackup within meta by $backupMeta = $meta->wire(new WireDatabaseBackup($backupPath)); which works creating pages but in this case throws another error, but as both run from the same pw installation (multisite) there is only one WireDatabaseBackup anyway.. and I also tried to specify a different path the code is supposed to be part of a cron, right now it sits in my site/init for testing So to clarify, my setup looks like this root - wire - site - site-meta - index.php - index.config.php everything else works as expected with this setup, so far.
  11. I forgot to mention that im initiating a second instance from /site/init.php You're my hero Thanks to you I identified the bad part, all good now.
  12. this one I'll have on production sure, but on staging I'm using www.staging.domain.com assets0.staging.domain.com and so on..
  13. I know about this post https://processwire.com/talk/topic/12198-modifying-config-property-eg-sitesettings-from-readyphp/ But I'm not modifying the settings somewhere else.. So my problem is about $config->httpHosts I'm getting this one on staging server when debug is enabled I'm just setting this in config.php as usual, tried various ways, this is how I would love it to be $config->domain = 'staging.domain.com'; $config->httpHosts = [ $config->domain, "www.$config->domain", "assets0.$config->domain", "assets1.$config->domain", "assets2.$config->domain", "assets3.$config->domain" ]; Then I only need to ensure $config->domain is set right in config and I can use it in other places, too.. Anyway, I stripped the line breaks, reduced the number of hosts, inlined the domain, changed [] to array(), commented the whole thing out..changed php from 5.6 cgi to 7 cgi, and tried to array merge with $config->httpHosts with no changes at all and now I have no idea what to do. Can just disable debug and at least the message disappears, but that won't fix the problem...would it?? Uh, another installation on the same host works just fine, just enabled debug, no error..
  14. good catch @netcarver I think the thing is that I always forget that 0.1.51 is greater than 0.1.6 thinking about it I'll totally get it the first is fiftyone not 5.1 but a little distracted and I mix those things up..class, plugins, versioning are still kind of new..especially versioning as I never took it seriously coding for myself not bound to any automatic update process or other people involved @kixe fixed expiration and version issues Because I'm curious I have to ask again..what exactly do you mean by this? For convenience (e.g. to use session based messages)? By law? Another general question..do those two branches master and devns make sense? Not that it's a big hassle to maintain, but again because I'm curious Saludos
  15. good to know about versioning thank you! and the expiration I'll check a little later thanks for spotting this..
  16. to use session based messages or what am I missing? no it's no pw selector, maybe I'll change wording? it enables you to provide a custom link target (useful at all) just pushed 0.1.6 with custom privacy page url
  17. Thanks @BitPoet, didn't had the time to follow the instructions so far.. but all db's/tables are utf8 already and were installed using utf8..I'm going to further check this and work the instructions of your linked article..
  18. I cheered too soon^^ not yet solved properly..instead of the "diamond" question mark icons I'm left with regular question marks which I can't just search and replace because the content contains question marks.. Any ideas?
  19. 1) pasting from db (adminer) to sublime it looks the same, just like whitespace 2) like str_replace(' ', ' ', $body) ? no difference Aha..thanks to your suggestion I then tried preg_replace('/\s+/', ' ', $body) and it worked! Thanks guys So what exactly happened here? what are those mysterious falty white spaces in reality? @Francesco Bortolussi hemos encontrado algunos italianos aka en el perú haha
  20. depends..you could use one PW with multiple page trees and you could limit templates based on those page trees (parents) another possibility would be to use multi-site setup and try the new multi-instance support..this way you can have more cleaner installations as every page uses it's own installation just sharing the same wire folder, but with the advantage of easily sharing data by bootstrapping one page (or more) from another More about multi-instance www.processwire.com/blog/posts/multi-instance-pw3/ for this you should use newest PW 3 (or at least 3.0.30) Note that when using multi-site you always update the core of all sites at once.. If modules will be same and you can update modules for all sites at once you could even symlink modules folder.. If that's a problem you could make independent pw installations and still use multi-instance to share data..
  21. I'm going to try your suggestions guys, actually the german umlauts work..the places where I'm getting the question marks seem to be just whitespace in the old and the new databse Import happens using the API (should've filed the question in the API section..), so I'm bootstrapping the old instance like $old = new ProcessWire('../old/', 'http://old.dev'); $categories = $old->pages->find("template=forum-category"); foreach ($categories as $cat) { $p = new Page(); $p->template = 'post'; $p->parent = $parent; $p->title = $cat->title; .. } and so on... Uh and I also tried setting output formatting on and of.. $p->of(false) @Francesco Bortolussi Estoy aprendiendo todavia..poco a poco Ah ja y ahora vives en los estados unidos o por donde? ¿Ha leído de nosotros proyecto? enlace en mi firma...
  22. Hey guys, As I'm refactoring one of our websites completely I thought it's nice to start from scratch and make use of new multi-instance support to import data from the old site. Most of it works nice so far, except I'm encountering a little (I guess) UTF-8 issue as the imported content within the new site has some black diamonds with question marks in it. I tried utf8_en/decode and combinations in any order, $sanitizer->purify / ->entities / ->unentities, htmlspecialchars and various other possible solutions with no luck Then I tried the same grabbing and inserting the body field directly from and to the db with no difference.. Both db's are utf8_general_ci and pw is at 3.0.33 As a side note, no question mark diamonds in the old (nor the new) db and old page content works as expected of course Uh I also tried to set charsets using php's header and ini_set functions.. Hopefully one got another idea
  23. thanks diogo nice read, for now I sort by template as it's mainly about having one extra article upfront..I'll invest this more if needed thanks guys
  24. had the same issue, killing before setting $wire in index.php would fast everything up just updated from 3.0.32 to 3.0.33 (wire folder and index.php) all speedy again
×
×
  • Create New...