[SOLVED] Fatal error when using custom display method for image field, inside a fieldgroup field

More
10 years 8 months ago - 10 years 8 months ago #54501 by agata
Hi,
I was delighted to find that the field group was introduced in the latest version of Flexi and I couldn't wait to use it. On the homepage of the project I'm doing I have a carousel consisting of 3 groups of fields (that until now I just had as a bunch of separate fields but was now trying to convert into a field group of 1 image field + 2 text fields + 1 textarea field) and it works like a charm except for the image field that causes the following error:
Fatal error: Cannot access empty property in /home/wilddogc/sandbox-select/plugins/flexicontent_fields/image/image.php on line 1340

EDIT: I also noticed that remove/delete checkboxes are not displaying for the image field within the field group on item edit page.

Any ideas as to why this might be happening?
Best,
Agata
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54502 by ggppdk
Hello

first, please use v3.0.0 BETA 7a
github.com/FLEXIcontent/flexicontent-cck/releases


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54503 by agata
Hi, installed but the error persists.
Best,
Agata
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54504 by ggppdk
Hello

but it is in different line, so you need to say the new line


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54505 by agata
Right, sorry, here it is
Fatal error: Cannot access empty property in /home/wilddogc/sandbox-select/plugins/flexicontent_fields/image/image.php on line 1346
A
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54506 by ggppdk
This is at line
$field->{$prop} = array();

- it seems $prop is empty string

-- try this fix, edit file:
plugins/flexicontent_fields/fieldgroup/ fieldgroup.php
Replace:
Code:
$method = $gf_methods[$pos] ? $custom_field_methods[$pos] : 'display';
with:
Code:
$method = $gf_methods[$pos] ? $gf_methods[$pos] : 'display';


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54507 by agata
Hi, thanks, that got rid of the fatal error. However now "field_home_carousel1_image##display_large_src" retrieves "/" instead of the path to the image. The field is published, added to group and added to a position in the template.
sandbox-select.wilddog.co.uk/ - the top part of the site has a carousel and each slide should feature a large image background. Other fields load correctly, just not the image.
Thanks for your help so far,
Agata

EDIT: I tested without the _src and the image loads correctly, the problem is I need it to be a background so I need to load just the path.
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54508 by ggppdk
Hello

that is a different issue, please give some good description because i don't understand where you are using this,
since i do not see a flexicontent universal content module with carousel template


-- Flexicontent is Free but involves a big effort on our part.
Like the our support? (for a bug-free FC, despite having a long list of functions) Like the features? Like the ongoing development and future commitment to FLEXIcontent?
-- Add your voice to the FLEXIcontent JED listing with a 5-star review. Thanks!
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago - 10 years 8 months ago #54509 by agata
Hi, I'm not using the module, that entire homepage is an article with a type Homepage that I built. The carousel features images (image field), titles (text field), text (textarea field) and links (text field). I created a group of fields so that I could have more items in the carousel but didn't need to create 3 fields of each. The custom code for my group field is as follows:
Code:
<div class="hero-carousel__item"> <div class="hero-carousel__bg" style="background-image:url('{{field_home_carousel1_image##display_large_src}}');"></div> <div class="hero-carousel__info-container"> <div class="hero-carousel__info pr+"> <h2 class="content-top__title">{{field_home_carousel1_title}}</h2> <div class="content-top__description">{{field_home_carousel1_text}}</div> <a href="{{field_home_carousel1_link}}" class="content-top__arrow-link"><i class="icon icon-right"></i></a> </div> </div> </div>

The images being loaded as backgrounds using the image field works fine in other parts of the website, only when I have the image loading as part of a group field it doesn't retrieve results when I try to load the path (_src). I checked and the images load correctly (as img tags) if I remove the _src, however I need them to be backgrounds.

I hope this helps. I need to run now but might provide more info later on tonight.
Best,
Agata
Last edit: 10 years 8 months ago by ggppdk.

Please Log in or Create an account to join the conversation.

More
10 years 8 months ago #54521 by agata
Good morning, were you able to recreate the issue?
Best,
Agata

Please Log in or Create an account to join the conversation.

Moderators: vistamediajoomlacornerggppdk
Cookies user preferences
We use cookies to ensure you to get the best experience on our website. If you decline the use of cookies, this website may not function as expected.
Accept all
Decline all
Essential
These cookies are needed to make the website work correctly. You can not disable them.
Display
Accept
Analytics
Tools used to analyze the data to measure the effectiveness of a website and to understand how it works.
Google Analytics
Accept
Decline
Save