-
Posts
2,776 -
Joined
-
Last visited
-
Days Won
40
Everything posted by Macrura
-
after upgrade all of a sudden my sites all started to show the alternate skin on CK editor, even though we I don't have that sub module enabled; enabling disabling the CKEaddons doesn't change anything, e.g. it still shows the wrong skin, and also the editor has redundant text align buttons; only way to fix was to disable module.
-
Here is a pre-release version on Github: https://github.com/outflux3/ImportExternalImages Still needs some cleaning up, but works fine so far in limited testing on 3 sites...
-
I guess we need to do some testing, with regards to the version number issue? not sure how to conveniently test it though, but could have a look at the upgrades module and try and see why it doesn't even list the CroppableImage3 module...
-
ok well yes, i was apparently running an older version (weird, just downloaded this from modules directory), but no idea how i had an out-of-date version, and the upgrades module shows nothing about this module... so this is fixed, by upgrading manually to the version on github
-
in the meantime i can see from some quick testing that the getCrop method is getting stuck here: // return InputfieldCroppableImage3 or null if not found $inputFieldInstance = $this->_getInputFieldInstance($event);
-
one of these was upgraded from the old cropping module to the new one, and one was started on 3x branch, and just added the cropping module; the module was probably installed after the upgrade to 3.0.52; not sure if any of those things make any difference; I can get you access to the admin and the FTP - i'm assuming you need both; will PM you in a bit.
-
yeah, when i first started the conversion, i was basically scratching my head about how hard/complex it would be to change from direct to delayed; At some point along the way i remembered the tracy template path, and after that it just went really fast.. now that site's code has been completely refactored and it's so much cleaner!
-
just popping by to say that Tracy made it possible for me to convert an old site where i was using direct output, to a delayed output model, which i needed to be able to handle the new requirements of the site; in particular, the template path feature was crucial – i was able to simply duplicate each template one at a time, rename to -dev, and work on the conversion until it was ready... Also the new styling looks great!
-
I have the same issue. The module was working great on 3.0.33, then i upgraded to 3.0.52 and the frontend method of getting the crop no longer works; the images are there in the folders with the suffix, and the backend stuff all works; just can't get the crops to output on the front end for some reason; the method is just returning null; I have another site on a different server where this is running on 3.0.52 and does work...
-
ok sure - yeah, you can use it as is now if you hardcode the field names; (i will setup a proof of concept module shortly on GitHub to have a fully installable module..)
-
ok - thanks - i will work on it and get it configurable, and do some more dummy testing...
-
thanks again - i learned a lot from studying the migrator as well as your other modules... I'm surprised this hasn't come up before, as i would think it quite common for clients to paste in HTML to the editor with external image references; My one client was totally confused because they would paste in these reviews with all of the images, not realizing the images were being pulled from external sites, and then they couldn't click the images in the editor;
-
right, if i copy your code more closely, then my function would be improved a lot...
-
cool - yes, thanks almost have this working using your examples!, will post final code once it's tested... Edit: this is the new improved version for specific usage; could be improved a lot (basically copy the migrator code), with the try/catch in case the external image can't be retrieved, and also allow for some additional checks for image field, RTE field; for most applications i can just add this to my SiteUtilities module and enable it for some specific templates and fields... public function importExternalImages($event) { $page = $event->arguments[0]; $html = $page->body; if (strpos($html,'<img') === false) return; //return early if no images are embedded in html $dom = new \DOMDocument(); $dom->loadHTML(mb_convert_encoding($html, 'HTML-ENTITIES', 'UTF-8')); $images = $dom->getElementsByTagName('img'); if(!$images->length) return; // not needed? $assetsPath = $this->pages->get($page->id)->filesManager()->url(); $extCount = 0; foreach ($images as $image) { $img_url = $image->getAttribute('src'); if(!filter_var($img_url, FILTER_VALIDATE_URL)) continue; $page->images->add($img_url); if($image->getAttribute('title') != ''){ $page->images->last()->description = $image->getAttribute('title'); } elseif($image->getAttribute('alt') != ''){ $page->images->last()->description = $image->getAttribute('alt'); } //resize image to make version to match the size originally in the RTE //check to make sure size is different to downloaded version before resizing if($image->getAttribute('width') && $image->getAttribute('width') != $page->images->last()->width) { $imgForRte = $page->images->last()->size($image->getAttribute('width'), 0); } else { $imgForRte = $page->images->last(); } $image->setAttribute('src', $imgForRte->url); $extCount++; } if(!$extCount) return; $page->of(false); //$page->body = $dom->saveHTML(); $page->body = preg_replace('/^<!DOCTYPE.+?>/', '', str_replace( array('<html>', '</html>', '<body>', '</body>'), array('', '', '', ''), $dom->saveHTML())); $page->save('body'); $this->message("image links updated to local images."); $page->save('images'); $this->message("external images imported to page"); } thanks again for your help and advice!
-
I'm working on a module that scans the textarea field and imports external images, and replaces the reference to them in the editor with the local version. This is the function that is hooked after Page save. Mods: http://modules.processwire.com/modules/import-external-images/ Github: https://github.com/outflux3/ImportExternalImages
-
cool, in that case it should be easy, you just use that exact syntax, but add the 'group' key: $selector = array( array( 'field' => 'date_pub_end', 'operator' => '<=', 'value' => $now, ), array( 'field' => 'date_pub_end', 'operator' => '=' , 'value' => '', 'group' => 'foo' ), array( 'field' => 'date_pub_end', 'operator' => '>=', 'value' => $now, 'group' => 'foo' ), ); i theeenk
-
I think the associative array option you may use either 'group' or 'or' to specify or-group, but i can't figure out how to do it, as the blog post that announced the feature doesn't explain how to do groups in selector arrays... do hope to find out how to do it soon... https://processwire.com/blog/posts/processwire-3.0.13-selector-upgrades-and-new-form-builder-version/#building-a-selector-string-with-user-input-example
-
-
-
Hi Adrian, those changes didn't fix the error;
-
ok thanks for helping out so fast, and hopefully this will help prevent this type of issue for forward versions!
-
OK - thanks @adrian i will need to test this after 5pm (i think the owners are working in the admin so I don't want to crash the site during NY business hrs..)
-
It's running 'version' => '4.0.4',
-
Not completely sure what happened, but i upgraded Tracy on a site running 2.7.3 and it killed the site. I fixed the permissions on all of the Tracy files which were set incorrectly after upgrade, but this didn't prevent the issue. Error: Call to a member function queryString() on null (line 507 of ....wire/core/WireInput.php) This error message was shown because you are logged in as a Superuser. Error has been logged.
-
Thanks, this is all working really well.