Oca2 Posted January 18, 2018 Share Posted January 18, 2018 Dear Processwirez, After updating to 2.8.62 some code doesn't seem to work anymore. There are no more images on the front-end. Image url's on front-end are empty. if($page->mosaik_title_1) { echo " <div class='three columns'> <a href='{$page->mosaik_url_1}/'> <span class='m1'>{$page->mosaik_title_1}</span> <img src='{$page->mosaic_photo_1->eq(0)->getThumb('thumbnail')}' alt='{$page->mosaic_photo_1->description}' /></a></div>";} and foreach($page->children as $child) echo " <div class='cat1 cat5'> <div class='port-item-container'> <div class='port-box'> <a rel='bookmark' title='{$child->title}' href='{$child->url}'> <img src='{$child->overviewimg->eq(0)->getThumb('thumbnail')}' alt='$child->title'> </a> </div> <div class='port-item-title'> <h6>{$child->title}</h6> <span>{$child->overviewtxt}...<a href='{$child->url}'> Lees verder »</a></span> </div> </div> </div> "; Both codes are from different pages and both doesn't work anymore after the upgrade. Link to comment Share on other sites More sharing options...
adrian Posted January 18, 2018 Share Posted January 18, 2018 Looks like you are using the old thumbnails module (http://modules.processwire.com/modules/fieldtype-crop-image/). You will need to upgrade to: http://modules.processwire.com/modules/croppable-image3/ Link to comment Share on other sites More sharing options...
Oca2 Posted January 18, 2018 Author Share Posted January 18, 2018 Thanks Adrian, I'm going to test it! Link to comment Share on other sites More sharing options...
Oca2 Posted January 19, 2018 Author Share Posted January 19, 2018 I have PW 2.8.62 running a live website... 75% of images are hidden/gone/... Can I just upgrade to 3.0.62 to get the module CroppableImage3 to work? Link to comment Share on other sites More sharing options...
Oca2 Posted January 24, 2018 Author Share Posted January 24, 2018 Ok... updated to 3.0.62 installed CroppableImage3 now I get the following errors... User Error Exception: Method Pageimage::getThumb does not exist or is not callable in this context (in /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php line 519) #0 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(386): ProcessWire\Wire->___callUnknown('getThumb', Array) #1 /domains/somesite.nl/DEFAULT/fresh/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___callUnknown', Array) #2 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Pageimage), 'callUnknown', Array) #3 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(445): ProcessWire\Wire->__call('callUnknown', Array) #4 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(445): ProcessWire\Pageimage->callUnknown('getThumb', Array) #5 /domains/somesite.nl/DEFAULT/fresh/site/assets/cache/FileCompiler/site/templates/home.php(16): ProcessWire\Wire->__call('getThumb', Array) #6 /domains/somesite.nl/DEFAULT/fresh/site/assets/cache/FileCompiler/site/templates/home.php(16): ProcessWire\Pageimage->getThumb('thumbnail') #7 /domains/somesite.nl/DEFAULT/fresh/wire/core/TemplateFile.php(268): require('/domains/gemsbo...') #8 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(380): ProcessWire\TemplateFile->___render() #9 /domains/somesite.nl/DEFAULT/fresh/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___render', Array) #10 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\TemplateFile), 'render', Array) #11 /domains/somesite.nl/DEFAULT/fresh/wire/modules/PageRender.module(514): ProcessWire\Wire->__call('render', Array) #12 /domains/somesite.nl/DEFAULT/fresh/wire/modules/PageRender.module(514): ProcessWire\TemplateFile->render() #13 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(383): ProcessWire\PageRender->___renderPage(Object(ProcessWire\HookEvent)) #14 /domains/somesite.nl/DEFAULT/fresh/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___renderPage', Array) #15 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\PageRender), 'renderPage', Array) #16 /domains/somesite.nl/DEFAULT/fresh/wire/core/WireHooks.php(782): ProcessWire\Wire->__call('renderPage', Array) #17 /domains/somesite.nl/DEFAULT/fresh/wire/core/WireHooks.php(782): ProcessWire\PageRender->renderPage(Object(ProcessWire\HookEvent)) #18 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\Page), 'render', Array) #19 /domains/somesite.nl/DEFAULT/fresh/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Wire->__call('render', Array) #20 /domains/somesite.nl/DEFAULT/fresh/wire/modules/Process/ProcessPageView.module(205): ProcessWire\Page->render() #21 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(383): ProcessWire\ProcessPageView->___execute(true) #22 /domains/somesite.nl/DEFAULT/fresh/wire/core/WireHooks.php(698): ProcessWire\Wire->_callMethod('___execute', Array) #23 /domains/somesite.nl/DEFAULT/fresh/wire/core/Wire.php(442): ProcessWire\WireHooks->runHooks(Object(ProcessWire\ProcessPageView), 'execute', Array) #24 /domains/somesite.nl/DEFAULT/fresh/index.php(55): ProcessWire\Wire->__call('execute', Array) #25 /domains/somesite.nl/DEFAULT/fresh/index.php(55): ProcessWire\ProcessPageView->execute(true) #26 {main} Link to comment Share on other sites More sharing options...
adrian Posted January 24, 2018 Share Posted January 24, 2018 21 minutes ago, Oca2 said: Method Pageimage::getThumb does not exist or is not callable in this context I don't think Croppable image has this method - I think you'll have to updated your API calls for this module. Link to comment Share on other sites More sharing options...
Oca2 Posted January 24, 2018 Author Share Posted January 24, 2018 changing... <img src='{$child->overviewimg->eq(0)->getThumb('thumbnail')}' alt='$child->title'> to... <img src='{$child->overviewimg->eq(0)->getCrop('thumbnail')}' alt='$child->title'> did not work... ...and give error: Exception: There is no crop setting for the template 'home' called 'thumbnail' (in /domains/gemsbok.nl/DEFAULT/fresh/site/modules/CroppableImage3/FieldtypeCroppableImage3/FieldtypeCroppableImage3.module line 209) And have set the crop setting to square,160,160 Link to comment Share on other sites More sharing options...
adrian Posted January 24, 2018 Share Posted January 24, 2018 You need to have a read of this: https://processwire.com/talk/topic/14251-upgrading-from-thumbnails-module-to-croppable-image-3/ Also note that once you have taken care of that, you need to add ->url to the end of your src - croppable image returns a pageimage object, not a url like the old module did. Link to comment Share on other sites More sharing options...
Oca2 Posted January 24, 2018 Author Share Posted January 24, 2018 2 minutes ago, adrian said: You need to have a read of this: https://processwire.com/talk/topic/14251-upgrading-from-thumbnails-module-to-croppable-image-3/ Also note that once you have taken care of that, you need to add ->url to the end of your src - croppable image returns a pageimage object, not a url like the old module did. no simple update... will look in to your link... Thanks for the info! Link to comment Share on other sites More sharing options...
Oca2 Posted January 25, 2018 Author Share Posted January 25, 2018 No more errors But... I don't want to go through the update process renaming all images files... to complicated so I will manually update the images... ...But if I select new images from admin they are still not visible on the front-end??? Link to comment Share on other sites More sharing options...
adrian Posted January 25, 2018 Share Posted January 25, 2018 24 minutes ago, Oca2 said: ...But if I select new images from admin they are still not visible on the front-end??? Have you looked at the path to the image in the HTML? Did you add the ->url at the end? If it's a multiple images field, you will also need ->first() in there or a foreach loop to get each image individually. Link to comment Share on other sites More sharing options...
Oca2 Posted January 25, 2018 Author Share Posted January 25, 2018 Tis is the code I use now, no errors but also no images on front-end <img src='{$page->mosaic_photo_1->eq(0)->getCrop('thumbnail')}' alt='{$page->mosaic_photo_1->description}' /></a></div>";} and <img src='{$child->overviewimg->eq(0)->getCrop('thumbnail')}' alt='$child->title'> Link to comment Share on other sites More sharing options...
adrian Posted January 25, 2018 Share Posted January 25, 2018 10 hours ago, Oca2 said: Tis is the code I use now, no errors but also no images on front-end Sorry to sound like a broken record, but CroppableImage returns a pageimage object, not a url, so you need to add ->url to the end of that: <img src='{$child->overviewimg->eq(0)->getCrop('thumbnail')->url}' alt='$child->title'> If you take a look at the HTML source of the page you would have seen that it was return an ID and not a URL to the image. Also another tip is to use the Console Panel in Tracy to investigate things. In particular note what happens when you echo (which outputs a string) that it returns the filename, but not the URL. 3 Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now