fnagel / generic-gallery Goto Github PK
View Code? Open in Web Editor NEWTYPO3 extension: Generic Gallery - One gallery to rule them all!
Home Page: https://extensions.typo3.org/extension/generic_gallery/
License: GNU General Public License v3.0
TYPO3 extension: Generic Gallery - One gallery to rule them all!
Home Page: https://extensions.typo3.org/extension/generic_gallery/
License: GNU General Public License v3.0
After installing the current version (5.1.0) of generic_gallery with PHP 7.4 and Typo3 11 the following warning is shown in case no name was given in the Typoscript setup:
PHP Warning: Undefined array key "icon" in ext/generic_gallery/Classes/Backend/Hooks/TcaHook.php line 67)
2 => ($view['icon']) ?: 'extensions-generic-gallery',
To fix this warning change the line to:
2 => (array_key_exists('icon', $view) && $view['icon']) ?: 'extensions-generic-gallery',
TYPO3 12.4.8
PHP 8.2.10
I have a gallery set to use a folder.
When I visit the page, I get an error 503 with the following error message :
Oops, an error occurred!
FelixNagel\GenericGallery\Domain\Model\GalleryItem::getImageReference(): Return value must be of type TYPO3\CMS\Extbase\Domain\Model\FileReference, null returned
I was able to work around the problem by changing the signature of getImageReference from
public function getImageReference() : ExtbaseFileReference
to
public function getImageReference() : ExtbaseFileReference | null
but I'm not confident enought that this is the correct way to fix the problem, or if indeed there is a problem (could I have done something wrong elsewhere ?), so I have not send a pull request yet.
Not sure if this error is my fault but I'm getting a parse error in backend after updating to 5.0.0 (running PHP 7.4 by the way):
(1/1) ParseError
syntax error, unexpected '|', expecting ';' or '{'
in ...\typo3conf\ext\generic_gallery\Classes\Domain\Model\GalleryItem.php line 88{ $this->textItems = new ObjectStorage(); } public function getIdentifier(): int|string { $identifier = $this->getUid(); if ($identifier === null) {
Since I upgraded my CMS to 8.7.1, the error [tx_generic_gallery] Error: Template for settings.gallery.bootstrap_slider_image not found!
started to occur randomly. I have no idea what is causing this. I have changed no paths of the extension nor changed the Typo Setup.
Sometimes it occurs 20 times an hour, it can then vanish for a longer time, sometimes over a week, and come back again.
Maybe it started since I used the Bootstrap Image Slider template to show images on some places of my website. But the gallery is working fine, even though the error lets you think of the opposite.
Is there any idea what could cause this?
Hi there,
I got the above error when trying to copy a newsletter with lots of elements, gridelements and images amongst others. Actually no gallery though...
To make it go away I had to deactivate the inline usage of sys_file_collection in the extension options, as well as add
'default' => 0,
to the config for 'tx_generic_gallery_collection' in
generic_gallery/Configuration/TCA/Overrides/tt_content.php
No idea how to fix the inline variant...
Greetings,
Manuel
Since I updated to TYPO3 8.7.16 LTS from 8.7.13, creating new or modifying old "Default" style gallerys in Mode 2 would cause in a broken image structure. I am sure the "Bootstrap Image Slider" layouts also had the same issues:
On the frontend, both the <a class="gallery">
and the <img>
, which it contains, shared the exact same image link, which was thumbnail sized and thus very low quality. Using a lightbox on top of this extension or trying to open the picture in full screen would cause the image to look terrible, as the original quality picture was linked nowhere.
Previously, the <a href="...">
tag contained a link to the original high quality picture which the lightbox/fullscreen would use, but this was no longer the case.
I was able to fix the problem by editing some Templates and Partials of this extension, but before proposing it to merge with master, I think it would be better to hear if anyone else also experienced the same issue - there is always the possibility that my issue was not caused directly by the TYPO3 update but rather in conjunction with another (incompatible?) extension.
Hi,
are there any known issues which prevent raising requirements (master) to: { "php": ">=5.5.0,<=7.2.99", "typo3/cms-core": ">=7.2.0,<=8.7.99" }
Regards,
Markus
I've was confronted with the error
requires php >=5.4.0,<7.1 -> your PHP version (7.4.5) overridden by "config.platform.php" version (7.4) does not satisfy that requirement.
I tried to use the gallery extension as base for my own gallery, only wanting to adjust the template file by overriding it in my provider extension.
So I installed generic_gallery 4.3.0, included the default typoscript template and set the constant to override the template directory:
plugin.tx_genericgallery.view.templateRootPath = EXT:myext/Resources/Private/Templates/
Then I created myext/Resources/Private/Templates/GalleryCollection/Show.html
and .. it did not get loaded.
(IMO this is the standard way of overriding templates in nearly all typo3 extensions).
To debug the issue, I removed generic_gallery's Show.html
and now got an exception:
(1/1) #1257246929 TYPO3Fluid\Fluid\View\Exception\InvalidTemplateResourceException
Tried resolving a template file for controller action "GalleryCollection->show" in format ".html",
but none of the paths contained the expected template file
(/var/www/typo3/public/typo3conf/ext/generic_gallery/Resources/Private/Templates/GalleryCollection/Show.html).The following paths were checked:
/var/www/typo3/public/typo3conf/ext/generic_gallery/Resources/Private/Templates/,
/var/www/typo3/public/typo3conf/ext/myext/Resources/Private/Templates/
I confirmed multiple times that /var/www/typo3/public/typo3conf/ext/myext/Resources/Private/Templates/GalleryCollection/Show.html
actually exists, which it did.
In the end I found that generic_gallery/Configuration/TypoScript/setup.typoscript
includes EXT:generic_gallery/Configuration/TypoScript/Examples/setup.typoscript
, which sets
plugin.tx_genericgallery.settings.gallery.default.template = EXT:generic_gallery/Resources/Private/Templates/GalleryCollection/Show.html
.. which overrides the template path configured earlier.
This is very confusing.
I suggest not loading the example typoscript with the standard generic_gallery typoscript (instead adding an example typoscript record that can be selected in the typoscript template setup), and adding a section about templating in the manual.
Hello,
i get this error on the gallery frontend page when an image collection with type "default gallery" is integrated with the type "images".
I use TYPO3 v10.4.14
Greetings,
Philipp
After installing the current version (5.1.0) of generic_gallery with PHP 7.4 and Typo3 11 the following warning is shown:
PHP Warning: Undefined array key "_LOCALIZED_UID" in ext/generic_gallery/Classes/Controller/AbstractController.php line 85
$this->uid = $data['_LOCALIZED_UID'] ?: $data['uid'];
To fix this warning change the line to:
$this->uid = array_key_exists('_LOCALIZED_UID', $data) && $data['_LOCALIZED_UID'] ?: $data['uid'];
Release is planned for end of this summer. Hopefully. Any help is appreciated!
WIP branch: https://github.com/fnagel/generic-gallery/tree/typo3-12
References
This is a work in progress task, see https://github.com/fnagel/generic-gallery/tree/typo3-11
Hello,
I installed the extension, add static TS and put the plugin on a page. I see the pictures in frontend, but there is no gallery function, only a list of pictures.
How is it possible to create a gallery without any javascript? No JS and CSS is loaded an there are no JS or CSS files in the extension code. What went wrong?
Best regards
Niklas
I haven't found a possibility to configure the max size of the zoom image. Is there any?
Hello,
right after installing this extension I get an error when inserting the plugin into a page:
"An error occurred trying to process items for field "Gallery type" (No typoscript settings available.)."
I found a similar problem on forge.typoe (https://forge.typo3.org/issues/76341#note-4) but this one was in combination with TV.
Can you give a hint please how to solve this?
PHP: 7.0.32
Typo3: 8.7.19
Regards
Would be nice if existing file collections (sys_file_collection) are selectable in the plugin settings.
Currently a new file collection is created with every and related to the content element.
Typo3 Version: 9.5.10
Plugin version: 3.0.0
Folowing Page Tree is given
Rootpage
->Subpage 1
->Subpage 2
-->Subsub 1 (Disabled)
-->Subsub 2 (Disabled)
-->Subsub 3 (Disabled)
->Subpage 3
[...]
Main Typoscript including generic gallery TS for own templates is applied to Rootpage. All pages (including the disabled ones) contain typoscript settings for Generic gallery if you check Typoscript object browser.
If you try to add generic gallery to one of the disabled pages, you will get an error (flashmessage) in Plugin Tab of the content element:
An error occurred trying to process items for field "Gallery type" (No typoscript settings available.).
And no templates are available to choose from.
Current fix for me: activating one of the subpages, adding gallerys to it and select templates. After this the subpage can be disabled again and plugins wont brake.
Not sure right now if this is plugin or typo3 core related. Other plugins like news don't show this specific behaviour.
Try to install Generic_Gallery, After installation and adding static TS Generic Gallery i get an exception '1316104317 Typo3\CMS\Extbase\Mvc\Exception. I am using Typo3 Ver.11.5, so I tried to add EXT:generic_gallery/Configuration/Routes/Default.yaml in config.yaml. (import (resources....) after RouteEnhancers. Then I got an exception "Symfony\Component\Yaml\Exception\ParseException You cannot define a mapping item when in a sequence at line 2 (near "NewsPlugin:")
May someone knows, what I am doing wrong and/or can give me an advice, how to add the default.yaml to my site configuration.
Thanks a lot.
Peter
Is there a way to access the metadata of FAL-items (i.e. title, description) and get it into the template? i am currently struggling to achieve this. Would be a very useful addition to this ext!
Hello Felix,
the RTE differs from the RTE in tt_content
column bodytext
.
It would be nice if you can switch to the new RTE implementation via wizard
configuration.
Nice greetings
Frömmi
After installing the current version (5.1.0) of generic_gallery with PHP 7.4 and Typo3 11 the following warning is shown:
Undefined array key "BACK_PATH" in /ext/generic_gallery/Classes/Backend/Hooks/PageLayoutViewHook.php line 173
It refers to the following code:
$this->imagePreviewHtml = BackendUtility::thumbCode(
$this->data,
'tt_content',
'tx_generic_gallery_images',
$GLOBALS['BACK_PATH']
);
The method thumbCode only accepts three params anyway. The fix is to remove the last parameter.
After change/upgrade from mysql-5.5 to mariadb-10 i had following problem:
When i try to insert new typo3-content, i became this message:
SQL error: 'Field 'tx_generic_gallery_predefined' doesn't have a default value' (tt_content:NEW589a3ba62f968221060887) (msg#1.1.12)
Default sql_mode in Ubuntu 16.04 Server for mariadb-10 is STRICT_TRANS_TABLES. BLOB and TEXT columns cannot have DEFAULT values. The BLOB and TEXT fields of generic-gallery are wrongly NOT NULL.
Example:
CREATE TABLE tbl (
a int(11) NOT NULL,
b tinytext NOT NULL
)
The tinytext field b has no default value. This is no problem, when the insert command has some value for b.
INSERT INTO tbl (a, b) VALUES (1, "hi");
INSERT INTO tbl (a, b) VALUES (2, "");
But while run insert without field b, an error occours.
INSERT INTO tbl (a) VALUES (3);
--> SQL error: Field 'b' doesn't have a default value
Workaround is to remove STRICT_TRANS_TABLES from sql_mode in /etc/mysql/my.cnf (or set only sql_mode=NO_ENGINE_SUBSTITUTION).
Real solution: I modified your ext_tables.sql for running with strict-trans-tables is active. I removed "NOT NULL" from any tinytext, mediumtext and blob field. Then default value is NULL.
#
# Table structure for table 'tx_generic_gallery_pictures'
#
CREATE TABLE tx_generic_gallery_pictures (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
sorting int(10) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
starttime int(11) DEFAULT '0' NOT NULL,
endtime int(11) DEFAULT '0' NOT NULL,
tt_content_id int(11) DEFAULT '0' NOT NULL,
title tinytext,
link tinytext,
images blob,
contents int(11) DEFAULT '0' NOT NULL,
PRIMARY KEY (uid),
KEY parent (pid)
);
#
# Table structure for table 'tx_generic_gallery_content'
#
CREATE TABLE tx_generic_gallery_content (
uid int(11) NOT NULL auto_increment,
pid int(11) DEFAULT '0' NOT NULL,
tstamp int(11) DEFAULT '0' NOT NULL,
crdate int(11) DEFAULT '0' NOT NULL,
cruser_id int(11) DEFAULT '0' NOT NULL,
deleted tinyint(4) DEFAULT '0' NOT NULL,
hidden tinyint(4) DEFAULT '0' NOT NULL,
starttime int(11) DEFAULT '0' NOT NULL,
endtime int(11) DEFAULT '0' NOT NULL,
pictures_id int(11) DEFAULT '0' NOT NULL,
bodytext mediumtext,
position tinytext,
width tinytext,
PRIMARY KEY (uid),
KEY parent (pid)
);
#
# Table structure for table 'pages'
#
CREATE TABLE tt_content (
tx_generic_gallery_items int(11) DEFAULT '0' NOT NULL,
tx_generic_gallery_predefined tinytext,
tx_generic_gallery_images blob,
tx_generic_gallery_collection int(11) DEFAULT '0' NOT NULL,
);
Will there be a Version of generic-gallery compatible with TYPO3 9 LTS in the near future?
Needs testing.
Migrated from https://forge.typo3.org/issues/12449
Migrated from https://forge.typo3.org/issues/72677
It would be nice if extension could display "title text" and "description" form images inserted to gallery by "Gallery Collection"
Hi!
Using PHP 7.1.4 (I know it is not supported yet, but in another thread you said it's just because you could not test it yet) and Typo3 7.6.18 I get the following error when trying to add the generic-gallery extension to a page:
Argument 1 passed to TYPO3\CMS\Extbase\Service\TypoScriptService::convertTypoScriptArrayToPlainArray() must be of the type array, null given, called in [redacted]/typo3conf/ext/generic_gallery/Classes/Service/SettingsService.php on line 173
In error-log, I can see the following additional information:
TypeError thrown in file [redacted]/typo3_src-7.6.18/typo3/sysext/extbase/Classes/Service/TypoScriptService.php in line 32.
If I try to edit the page where I added the plugin, this error message is still shown. I have to completly delete the page to eliminate the error. Opening the page via browser just shows a completly empty page.
Of course I'm not sure this is caused by my usage of PHP 7.1.4, but I wasn't able to find another user having the same problem and as PHP 7.1.4 is untested, I guess it has something to do with it.
Edit: I just noticed you live in Germany too, so if you want you can answer in German :)
If the title of an image is not set, the extension throws the following exception:
(1/1) TypeError
FelixNagel\GenericGallery\Domain\Model\GalleryItem::getTitle(): Return value must be of type string, null returned
To reproduce add the plugin on a page, go to the plugins-tab, add an image without a title at the "multible images" section, save and open the page in the frontend.
Easy fixable by changing corresponding model getter from this:
public function getTitle(): string
{
if ($this->isVirtual()) {
return $this->getImageData()['title'];
}
return $this->title;
}
to this:
public function getTitle(): string
{
if ($this->isVirtual()) {
return $this->getImageData()['title'] ?? '';
}
return $this->title;
}
Hey there,
when creating a gallery page using collection mode of generic_gallery, it works very good and all images are displayed like they should. If I now apply my 2-column layout to this page (via Backend-Layout), the layout of the gallery page changes (that's good) but every image is now shown twice! So before it was image-1 image-2 image-3
and now it's image-1 image-2 image-3 image-1 image-2 image-3
.
This issue does not occur when selecting all files using mass mode (so that's a workaround). Collection mode is working correctly without applying the (2-column) Backend-Layout.
Setup: CMS 8.7.1, PHP 7.1.4, generic_gallery 2.1.0. I can't confirm nor deny if the issue existed on previous versions of Typo3 / PHP / the extension.
Thanks for your great work, I really love the extension!
Hi Felix,
thank you for this extension. In table pictures
you have created the column sorting
already, but it was not used in your extension.
Can you please add it to the ctrl section of TCA and add default sorting in repository?
Thank you
Frömmi
If the user disables an gallery image (not one of the tx_generic_gallery_items but the "images" item inside the "tx_generic_gallery_items" item) an FE error occurs:
"Call to a member function getOriginalResource() on null"
The reason is in the model GalleryItem.php:
public function getImage()
{
**if ($this->image === null) {
return $this->imageReference->getOriginalResource()->getOriginalFile();**
}
Hello, In typo3 v8 some TCA migrations are needed for generic-gallery 2.1.0.
In typo3 v8.7 in het install tool the next migrations need to be applied. These should be fixed in extension itself.
The icon path of wizard "RTE" from TCA table "tx_generic_gallery_content['columns']['bodytext']['config']['wizards']['RTE']['icon']"has been migrated to tx_generic_gallery_content['columns']['bodytext']['config']['wizards']['RTE']['icon']" = 'actions-wizard-rte'.
RTE configuration via 'defaultExtras' options are deprecated. String "richtext:rte_transform[mode=ts_css]" in TCA tx_generic_gallery_content['columns']['bodytext']['defaultExtras'] was changed to options in tx_generic_gallery_content['columns']['bodytext']['config']
The TCA setting 'mergeIfNotBlank' was removed in TCA tx_generic_gallery_content['columns']['starttime']['l10n_mode'] and changed to tx_generic_gallery_content['columns']['starttime']['config']['behaviour']['allowLanguageSynchronization'] = true
The TCA setting 'mergeIfNotBlank' was removed in TCA tx_generic_gallery_content['columns']['endtime']['l10n_mode'] and changed to tx_generic_gallery_content['columns']['endtime']['config']['behaviour']['allowLanguageSynchronization'] = true
The TCA setting 'mergeIfNotBlank' was removed in TCA tx_generic_gallery_pictures['columns']['starttime']['l10n_mode'] and changed to tx_generic_gallery_pictures['columns']['starttime']['config']['behaviour']['allowLanguageSynchronization'] = true
The TCA setting 'mergeIfNotBlank' was removed in TCA tx_generic_gallery_pictures['columns']['endtime']['l10n_mode'] and changed to tx_generic_gallery_pictures['columns']['endtime']['config']['behaviour']['allowLanguageSynchronization'] = true
The TCA setting 'renderType' => 'inputDateTime' was added in TCA tx_generic_gallery_content['columns']['starttime']['config']
The TCA setting 'renderType' => 'inputDateTime' was added in TCA tx_generic_gallery_content['columns']['endtime']['config']
The TCA setting 'renderType' => 'inputDateTime' was added in TCA tx_generic_gallery_pictures['columns']['starttime']['config']
The TCA setting 'renderType' => 'inputDateTime' was added in TCA tx_generic_gallery_pictures['columns']['endtime']['config']
The link wizard has been migrated to a 'renderType' => 'inputLink '. It has been migrated from TCA table "tx_generic_gallery_pictures['columns']['link']['config']['wizards']['link']" to "tx_generic_gallery_pictures['columns']['link']['config']['renderType'] = 'inputLink'".
The RTE fullscreen wizard in TCA has been migrated to a 'fieldControl' = 'fullScreenRichtext'. It has been migrated from TCA "tx_generic_gallery_content['columns']['bodytext']['config']['wizards']['RTE']" to "tx_generic_gallery_content['columns']['bodytext']['config']['fieldControl']='fullScreenRichtext'".
The config option 'max' has been removed from the TCA for renderType='inputDateTime' in tx_generic_gallery_content['columns']['starttime']['config']['max']
The config option 'max' has been removed from the TCA for renderType='inputDateTime' in tx_generic_gallery_content['columns']['endtime']['config']['max']
The config option 'max' has been removed from the TCA for renderType='inputDateTime' in tx_generic_gallery_pictures['columns']['starttime']['config']['max']
The config option 'max' has been removed from the TCA for renderType='inputDateTime' in tx_generic_gallery_pictures['columns']['endtime']['config']['max']
SInse Bootstap 5 the their data attributes are namespaced (-bs).
This namespace is missing for the ride setting in
To fix, simply change this line:
<div id="gallery-{uid}" class="carousel slide" data-ride="carousel">
to:
<div id="gallery-{uid}" class="carousel slide" data-bs-ride="carousel">
Hi!
Is there a reason you a) use TYPO3 as vendor in the namespace (which is highly discouraged b) do not use PSR-4 autoloading?
Would you mind if I push a fix for this?
After installing the current version (5.1.0) of generic_gallery with PHP 7.4 and Typo3 11 the following warning is shown:
PHP Warning: Undefined array key "paginate" in ext/generic_gallery/Classes/Controller/GalleryCollectionController.php line 39
$this->currentSettings['paginate']['itemsPerPage'] ?: 10,
To fix this warning change the line to:
array_key_exists('paginate', $this->currentSettings) && $this->currentSettings['paginate']['itemsPerPage'] ?: 10,
When creating a gallery plugin with a file collection, saving that and then removing the file collection and saving again, an error occurs:
2: SQL error: 'Incorrect integer value: '' for column
typo3srh
.tt_content
.tx_generic_gallery_collection
at row 1' (tt_content:6040)
As suspected in #35, this is because the SQL mode of the MariaDB server is not empty but
$ SELECT @@sql_mode;
STRICT_TRANS_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER,NO_ENGINE_SUBSTITUTION
The problem can be worked around by modifying the database connection in LocalConfiguration.php
:
'DB' => ['Connections' => ['Default' => 'initCommands' => 'SET @@sql_mode="";']]]
The TYPO3 core uses the same configuration but does see this bug. Example: pages.mount_pid
.
mount_pid int(10) unsigned DEFAULT '0' NOT NULL,
type: group, internal_type: db, maxitems: 1, default: 0
When saving, the DataHandler
calls fillInFieldArray
, which calls checkValue
, which calls checkValueForGroupSelect
, which at last calls castReferenceValue
- and that one converts the empty string to a 0
.
tt_content.tx_generic_gallery_collection
has the exact same settings in Configuration/TCA/Overrides/tt_content.php
as pages.mount_pid
.
During debugging I found that this configuration changes, and DataHandler
has a different config than what is written in the Overrides file: type: inline, foreign_table: sys_file_collection, maxitems: 1, no default
array(5) {
["type"]=> string(6) "inline"
["foreign_table"]=> string(19) "sys_file_collection"
["appearance"]=> array(2) {
["collapseAll"]=> int(0)
["expandSingle"]=> int(1)
}
["maxitems"]=> int(1)
["minitems"]=> int(0)
}
So the problem is that the conversion to the inline selection removes the default value, and castReferenceValue
is unable to use it!
Please report this to the author of this package. Specifying the extension key will be mandatory in future versions of TYPO3 (see: https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ExtensionArchitecture/FileStructure/ComposerJson.html#extra)
In the log files you will get this error:
Wed, 30 Sep 2020 11:20:40 +0200 [WARNING] request="425c7c3dd9d1f" component="TYPO3.CMS.Core.TypoScript.Parser.TypoScriptParser": File "EXT:generic_gallery/Configuration/TypoScript/Examples/setup.txt" was not found.
In the setup.typoscript you have to change
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:generic_gallery/Configuration/TypoScript/Examples/setup.txt">
to
<INCLUDE_TYPOSCRIPT: source="FILE:EXT:generic_gallery/Configuration/TypoScript/Examples/setup.typoscript">
Migrated from https://forge.typo3.org/issues/12451
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.