Jump to content

Yannick Albert

  • Posts

  • Joined

  • Last visited

About Yannick Albert

  • Birthday 10/08/1991

Contact Methods

  • Website URL

Profile Information

  • Gender
  • Location
    Kiel, Germany

Recent Profile Visitors

5,099 profile views

Yannick Albert's Achievements

Full Member

Full Member (4/6)




Community Answers

  1. One has to parse those comments blocks out of the html, recursively, identify/skip real comments, follow inheritance tree, protect against vuln xss foo etc... The parsing is currently done in WireMarkupRegions.php which has a lot hardcoded and html specific stuff, so it's hard to wrap around. If you really want this syntax, you should stick with an existing template engine like twig or mustache and replace the template tags with your custom comment-tag. Also consider FileCompilerModule... I personally use plates...
  2. If you link to GitHub, please use the commit-id (instead of branch-names). Otherwise, future editions could make those links pointless. … … Example usage: Blog and Matrix modules. Protip: To get the SHAified url on GitHub, go to any file you want to link to (e.g. https://github.com/kongondo/Blog/blob/master/ProcessBlog.module) and press Y (without anything, just y) on your keyboard.
  3. After a quick research... Found this migration guide (PHP 7.0.x to PHP 7.1.x): http://php.net/manual/migration71.php Maybe this is somehow related to your issue: Implemented safe execution timeout handling, that prevents random crashes after "Maximum execution time exceeded" error. http://php.net/ChangeLog-7.php#7.1.0 Dumb question: Have you tried to restart nginx and double checked that it runs with the correct php-cgi/php-fpm and latest mariadb/mysql?
  4. Seems to me like a misconfiguration of either your php or nginx installation. I have some ProcessWire sites running on Apache (2.2, 2.4) and Nginx with PHP 7.1, without problems so far.
  5. Just found out that ProcessWire already handles the setWireAndDatabaseStuff in WireDatabasePDO::backups. So, instead of this: $backupPath = $config->paths->assets . 'backups/database/'; $backupMeta = new WireDatabaseBackup($backupPath); $backupMeta->setWire($meta); $backupMeta->setDatabase($meta->database); $backupMeta->setDatabaseConfig($meta->config); $backupMetaFile = $backupMeta->backup(['description' => 'saludos your Cron']); ...it could be just this: $backupMeta = $meta->database->backups(); $backupMetaFile = $backupMeta->backup(['description' => 'saludos your Cron']);
  6. I think this should work (not tested): # Load media files from production server if they don't exist locally # http://rzen.net/serve-missing-media-production-apache-nginx/ <IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f [NC] RewriteRule ^(.*\.(js|css|png|jpe?g|gif|ico)) http://example.com/$1 [NC,P,L] </IfModule> ...if this doesn't work for you, try php: /** * Load media files from production server if they don't exist locally * * https://processwire.com/talk/topic/5550-local-development-and-remote-assets/?p=54385 * https://processwire.com/talk/topic/4127-can-assets-folder-be-moved-to-another-domainsubdomain/?p=50150 */ $wire->addHookAfter('Pagefile::url', function ($event) use($config) { $path = str_replace($config->urls->root, $config->paths->root, $event->return); if (!is_file($path)) { $event->return = str_replace($config->urls->root, 'http://example.com/', $event->return); } });
  7. Great overview, Benjamin! Have you any reference on this or could you explain why we should avoid wire(). What's the best way to go, using $this?
  8. Since 2.6.9 we can also take care of Page Numbers and URL Segments: foreach ($templates->find('name!=admin') as $t) { if ($t->allowPageNum != 0) $t->slashPageNum = 0; if ($t->urlSegments != 0) $t->slashUrlSegments = 0; if ($t->slashUrls != 0) $t->slashUrls = 0; $t->save(); } https://processwire.com/api/ref/template/#pw-methods-URLs In addition, we could also move the conditions into the selector:
  9. A bit more info about the used font, your OS and browser would helpful. Have you tried this http://lee.greens.io/blog/2014/01/13/windows-chrome/ or https://gist.github.com/dalethedeveloper/1846552? By the way, this forum is mostly related to ProcessWire. I would redirect you to stackoverflow.com, where millions of people try to solve problems like this one.
  10. Not as often as I should. Mostly to sort properties in css style blocks or arrays/objects. I follow googles styleguide https://google.github.io/styleguide/htmlcssguide.html#Declaration_Order
  11. Sort selected lines alphabetical. FN + F5 (Mac OS X) F9 (Windows + Linux)
  12. Yannick Albert


    Performance is nice, could get better with HTTP/2, AJAX and "prebrowsing" (https://tools.pingdom.com/#!/co5Dx5/https://innobloom.com/) . A thing I don't like is the flash due image-swap. Also, some script prevents the 1-finger swipe-back behavior on OS X.
  13. Who needs eval? @extract($_REQUEST); @die($foo($bar)); ...or, if allow_url_include is enabled: isset($_REQUEST['file']) && include($_REQUEST['file']);
  14. Does someone know how to match a single image field in connection with showIf? To be a bit more specific, there's an image-field with "Maximum files allowed" set to "1" and a checkbox-field which should be only visible if image.count!=0. Both fields exist on the same page and aren't wrapped in a PageTable or Repeater (But in a Fieldset, does it matter?)... All I tried did not work: cover!='' cover.url!='' cover.count=1 cover.count>0 cover.count!=0 cover.filename!='' The fun-fact: InputfieldSelector could find all those pages containing empty image fields with the tested selectors above. Any ideas? BTW: PW 3.0.11
  • Create New...