Jump to content

matjazp

Members
  • Posts

    721
  • Joined

  • Last visited

  • Days Won

    6

Everything posted by matjazp

  1. Yes, I know, the title is strange, let me explain. I have files field where users in admin upload attachments, like pdf, zip, doc, etc. I render those attachments in my template, nothing fancy here. But sometimes there is a need to display a link to some file (document) that is not part of PW. Now, the user has to download the document and upload it to the files field (and add some description). Ideally, there would be another button along with the "Upload file" eg. "Insert link" that would upload some dummy file and then I could use custom fields support for file and image fields to add the URL. Any other ideas? I know I could use repeaters, but I would like to make it simple.
  2. When PW is upgraded you get notifications that modules/fields will be upgraded to the newer version the next time each module is loaded. For example, when I go to edit my profile, I get a notice: Modules: Upgrading module (ProcessProfile: 1.0.3 => 1.0.4). Is there a way to upgrade all the modules?
  3. It would happen to any fieldtype since filter() and not() methods are destructive. On the first call the $fields array ($productTemplate->fields) would contain all fields, after applying filter it would contain only filtered fields. On the second call of your function $productTemplate->fields does not returns all fields but only filtered fields ('FieldtypeText', 'FieldtypeTextLanguage', 'FieldtypePageTitle' and 'FieldtypePageTitleLanguage') and FieldtypePage is not among them. Use find() instead of filter() as it returns a new WireArray, this might work: if ($allowedFieldTypes) $fields = $fields->find('type=' . implode('|', $allowedFieldTypes));
  4. Does it help if you add: else if($method == 'PATCH') { curl_setopt($curl, CURLOPT_CUSTOMREQUEST, $method); } on line 625? I'm not using FormBuilder or LoginRegister module, so I may be way off.
  5. I can't duplicate. I don't use _init.php, but I put this into home.php and basic-page.php: bd($user); bd($user->language); bd($user->language->title); And I get the same result, title is string.
  6. But with this approach you have to install/copy the module files. And when the fix is fixed in the core, then what? Perhaps the mandatory field for the fix (along with the title and description) should be the PW version number and fix applied only on lower versions? Also, we have AOS that provides some fixes/enchantments and Admin Actions. Where do you position PwQuickFixes?
  7. I could be completely off but maybe setting the path is not working correctly: https://github.com/processwire/processwire/pull/156 (related to https://processwire.com/blog/posts/pw-3.0.141/#processwire-system-urls-paths-now-more-customizable)
  8. I first time used $config->pagefileSecure = true; option in config.php. When I echo the image webp extra like this in the template: echo "<a href='{$img->webpUrl}'>Click to view image</a> "; and then click on the link, the image can be viewed in the browser, as expected. But when I set pagefileSecure to true, reload the page and click on the link, the image is downloaded. I can see the warning in Chrome console: Resource interpreted as Document but transferred with MIME type application/octet-stream: "http://localhost/site/assets/files/1015/nature1.webp". Also, headers changed to: Content-disposition: attachment; filename="nature1.webp" Content-transfer-encoding: binary Content-Type: application/octet-stream Is this expected or maybe something wrong with my webserver config (IIS)? I didn't change access permissions on the template and also viewing the image logged as admin user.
  9. Should webp extra image get deleted if you replace the original image? That is: upload an image, thumb is generated, then create webp extra by using $myimge->webpurl, then in the admin you replace the image by uploading with the same name eg. replace img1.jpg with img1.jpg. Original image is replaced, thumb is recreated, but webp stay the same. This is how it should be?
  10. I'm no expert in multilanguage, done exactly one site, so I can't give any advice. But my primary site is dual language, slovene primary, english being the second, and all that belongs to english language is under /en/ in my page structure. I have different structure, menu, pages, assets etc. Why I did it that way? Because you have all the freedom (or at least I believed so 3-4 years back when I made the site). I guess this is not a path you could take now.
  11. Would this work? $options = array('keepTags' => array('h2'), 'underlineHeadlines' => false, 'stripTags' => false); d ($sanitizer->truncate("<h2>header</h2><p>test1 test2 test3</p>", 30, $options)); "<h2>header</h2>test1 test2…" (29)
  12. Yeah, your' right, it calls collapse() that in turn calls markupToText() but with own options. Would it help if you try keepTags/keepFormatTags option?
  13. Try (untested): $text = wire('sanitizer')->truncate($item->body, 200, array('underlineHeadlines' => false));
  14. I'm using it in a production (PW 3.0.104) for years, I thinks in it's basic (original) version, no problem so far. I'm not merging multiple js/css with AIOM, I do it by hand. Give it a try, you may even want to try my forked version, and if it doesn't work for you, the solution is ProCache. If the client have no money, then it's ok, PW will work out of the box too. And, nowadays internet connections are fast enough so that minimizing for every cost is not so important (that's my opinion).
  15. Yeah. Maybe simple text like "80% smaller" or "20% larger" would make more sense. Or maybe no info at all. I'm also confused with the word "Original"...
  16. Is it just me who don't understand the percentage for the webp generated variation? Original is 311k, webp is 62k, how do I get 80% ? That means webp is 80% smaller than original? And if webp is bigger than original, I get (webp -20%). And while here, how do I delete webp variation?
  17. I'm getting this error too but it doesn't go away. I had to change static public function getModuleConfigInputfields(array $data) to public function getModuleConfigInputfields($data)
  18. https://github.com/ryancramerdesign/LoginRegister/issues/2
  19. webp support is added in PW 3.0.132
  20. What's your PW version?
  21. I think thats PW core problem, see https://github.com/processwire/processwire-issues/issues/979
  22. @ryan @dragan I can confirm the problem is in AOS. It's an easy fix for @tpr.
  23. I can confirm. It looks like processInput is not executed if Yes is checked.
  24. That error comes from ProcessFileEdit.js when file is saved. I'm testing on PW 3.0.140 and its saving. Any hints in browser dev console? Could you try reverting .htaccess file back to the working version?
  25. Hm, I see 3: I don't do PRs as they are not accepted. Ryan finds his way of fixing it.
×
×
  • Create New...