gordonbanderson / ss3gallery

Gallery that uses other Web of Talent modules
BSD 3-Clause "New" or "Revised" License
0 stars 1 forks source link

Fatal error: Interface 'RenderableAsPortlet' not found #1

Open Legin76 opened 8 years ago

Legin76 commented 8 years ago

Hi

Using silverstripe 3.1.16, after uploading the files, when I run /dev/build?flush=ALL I get the error below.

Fatal error: Interface 'RenderableAsPortlet' not found in /home/swimming/public_html/ss3gallery/code/GalleryImage.php on line 4

gordonbanderson commented 8 years ago

OK, that's a missing module dependency. I've uploaded a heap of modules recently and haven't had time to test them all. This one is marked as build failing I notice. Fixing...

Legin76 commented 8 years ago

Fab thanks...

gordonbanderson commented 8 years ago

Looks like I need to fix sub module dependencies and the SEO extension is also tripping up on tests, though that one is not my fault :)

To get going for now, and I will fix from composr ASAP clone the following:

 git clone git@github.com:gordonbanderson/weboftalent-portlets.git portlets
 git clone git@github.com:gordonbanderson/Mappable.git mappable
 git clone git@github.com:gordonbanderson/page-with-image.git pagewithimage
 git clone git@github.com:gordonbanderson/weboftalent-twitter-tools.git twitter-tools
 git clone git@github.com:gordonbanderson/silverstripe-liveseo.git seo

SEOSiteTreeExtension.php is breaking for me during the build, temporarily comment out lines that break. I have to go out now, will endeavour to fix in next 24 hrs or so for a clean composer install

gordonbanderson commented 8 years ago

All tests marked as skipped but no errors due to syntax or missing packages, see https://travis-ci.org/gordonbanderson/ss3gallery/builds/106472801

This is with

composer require "weboftalent/ss3gallery:~1"
gordonbanderson commented 8 years ago

I've fixed the dependent package builds also that were broken. Can you have another go and let me know if you still see problems or not?

Legin76 commented 8 years ago

Hi... Getting closer. I've re-installed it. The first time, I think I missed one of the dependencies of one of the dependencies.

I can create a page with image but when I try and add a gallery to it I get the error below.

[User Deprecated] GridFieldBulkUpload->setConfig is deprecated. GridFieldBulkUpload 'setConfig()' doesn't support 'folderName' anymore. Please use 'setUfConfig()', 'setUfSetup()' or 'setUfValidatorSetup()' instead. Called from GalleryPage->getCMSFields.

gordonbanderson commented 8 years ago

Sorry, we seem to be in different time zones (guessing you are UKish), I am in Thailand. Saw the notification as I shot out the door earlier. Will test manually tomorrow.

Legin76 commented 8 years ago

That's no problem at all. I'm just happy you responded.

gordonbanderson commented 8 years ago

If you update the module it should now work in that it doesn't break. Gridfield bulk editing tools was also missing from the requirements.

Legin76 commented 8 years ago

Almost there... It looks like the dependency / settings errors are fixed but I'm getting some strange things in the templates. See the attached images

Folder Page

Gallery Page

gallery-folder gallery-page

Legin76 commented 8 years ago

Ok... The level test stuff and Gallery page override appear to be simple template things that I can fix. I'm not sure what the map bit relates too but I can remove that too. Which just leaves the gallery image which uses the code below.. I just need it to output a gallery thumb at one size. Then we are laughing.

<img class="shadowbox" alt="Photograph of $Top.Title" data-interchange="[$PortletImage.CroppedFocusedImage(268,147).URL, (default)],[$PortletImage.CroppedFocusedImage(640,427).URL, (small)],[$PortletImage.CroppedFocusedImage(220,157).URL, (medium)],[$PortletImage.CroppedFocusedImage(268,179).URL, (large)]">

There does appear to be some unused fields such as date and image credit but that are not an issue and I'm sure are there for future use.

gordonbanderson commented 8 years ago

I haven't got as far as the templates, wrestling with import of EXIF data at the moment. I will need to add an extension hook and an optional extension to remove the map editing functionality. Easy enough to do though :)

Legin76 commented 8 years ago

Thanks for your help with this.. I used the old ss3 gallery on other sites. It's ideal for what I need.

gordonbanderson commented 8 years ago

The following, that you referred to, is image data for Zurb Foundation - it chooses the size depending on the size of the viewer screen, e.g. phone, panoramic monitor etc.

<img class="shadowbox" alt="Photograph of $Top.Title" data-interchange="[$PortletImage.CroppedFocusedImage(268,147).URL, (default)],[$PortletImage.CroppedFocusedImage(640,427).URL, (small)],[$PortletImage.CroppedFocusedImage(220,157).URL, (medium)],[$PortletImage.CroppedFocusedImage(268,179).URL, (large)]">

You will need something like:

<img src="$PortletImage.Width(300).URL" alt="whatever" title="whatever"/>

Oh and the CroppedFocusImage call is for another module, https://github.com/jonom/silverstripe-focuspoint - it allows a content editor to mark a point of an image as the main point of interest. This then means images can be cropped to the same size and not have likes of heads chopped off.

Told you I hadn't tested this module properly.... but should be able to get it up and running out of the box fairly quickly.

Legin76 commented 8 years ago

Haha... I didn't even spot that there was no src in that.

I get the impression you initially used it on your own site for something and then decided to upload it for others. I'm trying to avoid adding unnecessary add-ons at the moment to make future upgrades easier, so will avoid focuspoint for now.

$PortletImage.Width(300).URL doesn't output anything. I also tried $Image.Width(300).URL, with no luck though.

Legin76 commented 8 years ago

I've worked out the gallery folder images after looking at the page with image code.

<% with MainImage %>
    <% with PaddedImage(300,240, 002144) %>
    <a href="$Link"><img class="introductoryImage" src="$URL" alt="$Top.Title" class="center"/></a>
    <% end_with %>
<% end_with %>
gordonbanderson commented 8 years ago

I've fixed most of the issues now, it should work 'out of the box'. I've resurrected the original image box also using Pretty Photo library. Documentation regarding extensions the main thing left to do now :)

Legin76 commented 8 years ago

That's a huge improvement. Good going. I'm still not getting the folder images loading... It appears that $PortletImage.Fill(300,200).URL is not working.. I do have the portlet add-on installed too. It does work with the code mentioned above.

gordonbanderson commented 8 years ago

Oh maybe that is 3.2 only, which is what I am testing with

Legin76 commented 8 years ago

Could be.. Thanks for your help... I'll tweak my templates to suit. Good work!

gordonbanderson commented 8 years ago

It should be possible to add a method that checks for the existence of FocusPoint, 3.2 and then 3.1 methods and choose the best one accordingly. And in such a manner that breaks do not occur.

gordonbanderson commented 8 years ago

Can you test the latest version. I've added documentation and tests.

Legin76 commented 8 years ago

Doh.. Fatal Error when running /dev/build?flush=ALL

Fatal error: Call to undefined function exif_read_data() in /home/swimming/public_html/ss3gallery/code/ImageMetaDataExtension.php on line 25

gordonbanderson commented 8 years ago

That's odd as it's a built in PHP function, see http://php.net/manual/en/function.exif-read-data.php

Legin76 commented 8 years ago

What's also strange is that I've just gone back to Saturdays version and it's still giving me the same error... I'm wondering if there is something cached.

Legin76 commented 8 years ago

Ok so it looks like Saturdays version had the error. I just didn't notice when I ran /dev/build?flush=ALL at the time.

Legin76 commented 8 years ago

This may just be as simple as exif not being installed... Just recompiling apache and will report back.

Legin76 commented 8 years ago

Bingo... That's sorted it.. Everything is looking good for me out of the box now.

gordonbanderson commented 8 years ago

What system are you running on that you have to compile Apache out of curiosity. And what is the name of the package so I can add it to the notes.

Legin76 commented 8 years ago

It's a CentOS server with cpanel. It has php 5.6.17 installed. I had to go into the easy apache, Exhaustive Options List, check Exif and do a new build.