• Hello Fabrik Community

    Fabrik is now in the hands of the development team that brought you Fabrik for Joomla 4. We have recently transitioned the Fabrik site over to a new server and are busy trying to clean it up. We have upgraded the site to Joomla 4 and are running the latest version of Fabrik 4. We have also upgraded the Xenforo forum software to the latest version. Many of the widgets you might have been used to on the forum are no longer operational, many abandoned by the developers. We hope to bring back some of the important ones as we have time.

    Exciting times to be sure.

    The Fabrik 4.0 Official release is now available. In addition, the Fabrik codebase is now available in a public repository. See the notices about these in the announcements section

    We wish to shout out a very big Thank You to all of you who have made donations. They have really helped. But we can always use more...wink..wink..

    Also a big Thank You to those of you who have been assisting others in the forum. This takes a very big burden off of us as we work on bugs, the website and the future of Fabrik.

Show media in Form view possible bug? (.JPG)

Mustafa_s

Member
Hello Guys,

I have 10 different fileupload elements, all working fine and with multiple file types (zip, pdf, tar, jpg). Having said that, no matter what setting I use on the fileupload element I can't stop Form view in showing the .JPG images in-line. What I mean by that is, I would simply like to have a link to the image (as I do with all the other file types) instead of actually showing the image within Form view. See the below image for an example, notice how the first 4 file types are simply links to download, I would like to achieve the same with images (.JPG files). I just want that name of the file and extension of .JPG files, just like the other file types.

How can I achieve this? No matter what setting I tried I can't get this to work, is this a bug?

Ldy92rc.png
 
There's no option to display an image as filename.
You can use jlayout to override the standard behaviour, e.g. just doing
Code:
<?php
defined('JPATH_BASE') or die;
$d      = $displayData;
    ?>
    <a href="<?php echo $d->fullSize; ?>"><?php echo basename($d->file);?></a>
http://fabrikar.com/forums/index.php?wiki/jlayouts/

It seems at the moment "Overriding an element JLayout for a specific element" is not working.
 
Hi Troester,

I'm not sure why but the Jlayout method to override the standard behaviour is not working. Here is what I did:

1) Created /templates/protostar/html/layouts/com_fabrik
2) Placed fabrik-element-fileupload-image.php into /templates/protostar/html/layouts/com_fabrik
3) Ensured fabrik-element-fileupload-image.php within /templates/protostar/html/layouts/com_fabrik contains the following code:
Code:
<?php
defined('JPATH_BASE') or die;
$d      = $displayData;
    ?>
    <a href="<?php echo $d->fullSize; ?>"><?php echo basename($d->file);?></a>
4) Refreshed the front-end details or forms view but the image (JPG or JPEG) files are still displayed, instead of just displaying the filename.

What can I be doing wrong? For whatever the reason, modifying the fabrik-element-fileupload-image.php file within /plugins/fabrik_element/fileupload/layouts has no impact either?

I also tried to place the file into these folders without success:

/templates/protostar/html/layouts
/layouts

Thanks.
 
Last edited:
Strange, the pathes are looking ok (and modifying the original should have an effect in any case).

Are you running a recent GitHub version?
You can put a debugging
echo 'here is path xy';
 
Troester,

Apologies as I should have previously mentioned that I'm running 3.3.1 - I tried upgrading to the latest version via Joomla extension manager (which worked fine), but then when I tried to load my frontend I received two major Fabrik errors that stopped my site from loading properly. So I had to roll back, I have since been making changes on my development site and then applying changes to my production site.
 
The jlayout is only in the latest version (and still work in progress).
two major Fabrik errors that stopped my site from loading properly
Which ones?
I would suggest to update from GitHub (on your dev site)
 
Troester,

I completed updating from the latest GitHub, all of the Fabrik extensions show 3.3.4 version. With the latest GitHub update I can confirm that Jlayouts works (pretty cool how this works BTW). Now the media files only display their filename instead of the whole image. That being said, the major error message I'm receiving when adding new records or editing existing records is below. Note that this error only started to appear when I tried to upgrade Fabrik through the Joomla Extensions manager. I'm not sure if this error would appear if I had directly upgraded via GitHub instead.

Fatal error
: Call to a member function clearDefaults() on a non-object in /home/domain/public_html/domain.com/components/com_fabrik/models/group.php on line 1195

You think this is related to Joomla Extension manager screwing something up? Should I not have upgraded through Joomla's extension manager and used GitHub instead?
 
Troester,

I reverted back to my original state on my development site and then instead of upgrading via Joomla Extension manager I used GitHub. I still receive the same error message above.

Fatal error: Call to a member function clearDefaults() on a non-object in /home/domain/public_html/domain.com/components/com_fabrik/models/group.php on line 1195

Looking at near line 1195 I see the following comment:

* $$$ hugh - added the clearDefaults method and need to call it here, otherwise if any pre-processing
* has already called the element model's getValue(), the change we just made to formdata won't get picked up
* during the row store processing, as getValue() will return the cached default.
 
Last edited:
Is your FK element on the joined table published? That code is handling saving of joined groups (usually repeat groups), where you have your 'parent' table joined to the 'child', and the FK is the element on the 'child' which holds the PK value of the parent, to make that child.parent_id -> parent.id relationship.

-- hugh
 
Hugh,

You were right on the ball, after removing an unused joined table things worked right away. And also right about it being a repeat group.

Just some background, I had a joined table with elements in a repeat group. I no longer used those elements and groups (both deleted) but the joined table was still active.

Much appreciate the help and assistance.

Mustafa
 
We are in need of some funding.
More details.

Thank you.

Members online

Back
Top