My Name is Frederic Köberl and I currently work as a Principal Web Developer at @Dynatrace in Linz, Austria.
Here is a random photo from my Unsplash. Enjoy!
Shows all relations of an element.
Home Page: https://plugins.craftcms.com/element-relations
License: Other
My Name is Frederic Köberl and I currently work as a Principal Web Developer at @Dynatrace in Linz, Austria.
Here is a random photo from my Unsplash. Enjoy!
Currently the plugin can't be installed on PHP 8 because of the composer requirement for illuminate/collections -- adding ^9.0 as a possibility will fix the problem.
Would be nice to use the Flyouts to quick edit the related elements.
SQLSTATE[54000]: Program limit exceeded: 7 ERROR: index row size 3248 exceeds maximum 2712 for index "idx_ncqxrcfezowfzzbexzbizkgivjmmyonsselc" HINT: Values larger than 1/3 of a buffer page cannot be indexed. Consider a function index of an MD5 hash of the value, or use full text indexing. The SQL being executed was: UPDATE "elementrelations" SET "relations"='|elements-start-
We have many element relation fields within Super Tables. Both Entries field types and LinkIt fields. Is this supported? We're not seeing them reported in the Element Relations fields we have enabled for different sections.
Element relations that have been cached using a command-line queue command have the base URL of the primary site as the baseUrl in the links.
With Element Relations 2.0.0 beta installed on a Craft 4 multi-site install, I'm unable to create new entries by clicking the "New Entry" button in the main entries view. I'm getting the following in phperrors.log
when I try:
PHP Fatal error: Type of internetztube\elementRelations\jobs\EventElementAfterSaveJob::$description must be ?string (as in class craft\queue\BaseJob) in /Users/me/Documents/myproject/vendor/internetztube/craft-element-relations/src/jobs/EventElementAfterSaveJob.php on line 10
Craft version: 4.0.3
Element Relations 2.0.0-beta.2
Push Cache Refresh Job Into Queue
buttonThe cache should rebuild in the background using the queue.
Failed queue job with the following error message
Error | Argument 1 passed to internetztube\elementRelations\jobs\CreateRefreshElementRelationsJobsJob::internetztube\elementRelations\jobs{closure}() must be an instance of Tightenco\Collect\Support\Collection, instance of Illuminate\Support\Collection given, called in /home/forge/[projectname]/vendor/illuminate/collections/Traits/EnumeratesValues.php on line 242
PHP version 7.4.26
Linux 5.4.0-88-generic
MySQL 5.5.5
Craft Pro 3.7.27.2
Element Relations 1.2.6
Currently 21.77% of all elements, which have an Elements Relations-Field in their field layout, are cached.
In absolute terms this means 539 out of 2476 elements are cached.
Migration fails when upgrading from 1.0.6 to 1.2.3. Running Craft Pro 3.7.30.1
`Database Exception: SQLSTATE[HY000]: General error: 1828 Cannot drop column 'siteId': needed in a foreign key constraint 'fk_hsuqnkfyhtjzftcimobzwkwtwqutqrjuloos'
The SQL being executed was: ALTER TABLE elementrelations DROP COLUMN siteId
Migration: internetztube\elementRelations\migrations\m220104_164702_simplify_cache_strategy
Output:
drop column siteId from table {{%elementrelations}} ...Exception: SQLSTATE[HY000]: General error: 1828 Cannot drop column 'siteId': needed in a foreign key constraint 'fk_hsuqnkfyhtjzftcimobzwkwtwqutqrjuloos'
The SQL being executed was: ALTER TABLE elementrelations DROP COLUMN siteId (vendor/yiisoft/yii2/db/Schema.php:676)
#0 vendor/yiisoft/yii2/db/Command.php(1307): yii\db\Schema->convertException(Object(PDOException), 'ALTER TABLE el...')
#1 vendor/yiisoft/yii2/db/Command.php(1102): yii\db\Command->internalExecute('ALTER TABLE el...')
#2 vendor/yiisoft/yii2/db/Migration.php(392): yii\db\Command->execute()
#3 vendor/internetztube/craft-element-relations/src/migrations/m220104_164702_simplify_cache_strategy.php(13): yii\db\Migration->dropColumn('{{%elementrelat...', 'siteId')
#4 vendor/craftcms/cms/src/db/Migration.php(52): internetztube\elementRelations\migrations\m220104_164702_simplify_cache_strategy->safeUp()
#5 vendor/craftcms/cms/src/db/MigrationManager.php(232): craft\db\Migration->up(true)
#6 vendor/craftcms/cms/src/db/MigrationManager.php(148): craft\db\MigrationManager->migrateUp(Object(internetztube\elementRelations\migrations\m220104_164702_simplify_cache_strategy))
#7 vendor/craftcms/cms/src/services/Updates.php(250): craft\db\MigrationManager->up()
#8 vendor/craftcms/cms/src/controllers/BaseUpdaterController.php(532): craft\services\Updates->runMigrations(Array)
#9 vendor/craftcms/cms/src/controllers/UpdaterController.php(201): craft\controllers\BaseUpdaterController->runMigrations(Array, 'restore-db')
#10 [internal function]: craft\controllers\UpdaterController->actionMigrate()
#11 vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#12 vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#13 vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('migrate', Array)
#14 vendor/craftcms/cms/src/web/Application.php(287): yii\base\Module->runAction('updater/migrate', Array)
#15 vendor/craftcms/cms/src/web/Application.php(684): craft\web\Application->runAction('updater/migrate')
#16 vendor/craftcms/cms/src/web/Application.php(244): craft\web\Application->_processUpdateLogic(Object(craft\web\Request))
#17 vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#18 web/index.php(22): yii\base\Application->run()
#19 {main}`
This one is kind of hard to define repro steps for, but I'm glad to provide a db backup and composer files via email if it's helpful.
I created an Element Relations field and added it to the field layout of several channels. In most channels, it's working as expected, but in one specific channel I don't see any significant difference between, I'm getting an "Invalid Owner ID" error when trying to view the entry's relations field.
[web.ERROR] [yii\base\InvalidConfigException] yii\base\InvalidConfigException: Invalid owner ID: 3746 in /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php:158
Stack trace:
#0 /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php(203): craft\elements\Entry->getPrimaryOwner()
#1 /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php(235): craft\elements\Entry->getOwner()
#2 /var/www/html/vendor/craftcms/cms/src/base/Element.php(3294): craft\elements\Entry->getField()
#3 /var/www/html/vendor/craftcms/cms/src/elements/Entry.php(1646): craft\base\Element->canView(Object(craft\elements\User))
#4 /var/www/html/vendor/craftcms/cms/src/services/Elements.php(4183): craft\elements\Entry->canView(Object(craft\elements\User))
#5 /var/www/html/vendor/craftcms/cms/src/helpers/Cp.php(811): craft\services\Elements->canView(Object(craft\elements\Entry), Object(craft\elements\User))
#6 /var/www/html/vendor/craftcms/cms/src/helpers/Cp.php(470): craft\helpers\Cp::baseElementAttributes(Object(craft\elements\Entry), Array)
#7 /var/www/html/vendor/craftcms/cms/src/helpers/Cp.php(1017): craft\helpers\Cp::elementChipHtml(Object(craft\elements\Entry), Array)
#8 /var/www/html/vendor/internetztube/craft-element-relations/src/twigextensions/ControlPanel.php(15): craft\helpers\Cp::elementPreviewHtml(Array)
#9 /var/www/html/storage/runtime/compiled_templates/fe/fe602748cbd630f83e73747b7fa1ea95.php(71): internetztube\elementRelations\twigextensions\ControlPanel->internetztube\elementRelations\twigextensions\{closure}(Array)
#10 /var/www/html/vendor/twig/twig/src/Template.php(394): __TwigTemplate_8ec2633b68b841f22d01a657276f2743->doDisplay(Array, Array)
#11 /var/www/html/vendor/twig/twig/src/Template.php(367): Twig\Template->displayWithErrorHandling(Array, Array)
#12 /var/www/html/vendor/twig/twig/src/Template.php(379): Twig\Template->display(Array)
#13 /var/www/html/vendor/twig/twig/src/TemplateWrapper.php(38): Twig\Template->render(Array)
#14 /var/www/html/vendor/twig/twig/src/Environment.php(280): Twig\TemplateWrapper->render(Array)
#15 /var/www/html/vendor/craftcms/cms/src/web/View.php(494): Twig\Environment->render('element-relatio...', Array)
#16 /var/www/html/vendor/internetztube/craft-element-relations/src/controllers/ElementRelationsController.php(27): craft\web\View->renderTemplate('element-relatio...', Array)
#17 [internal function]: internetztube\elementRelations\controllers\ElementRelationsController->actionGetByElementId()
#18 /var/www/html/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array(Array, Array)
#19 /var/www/html/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams(Array)
#20 /var/www/html/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction('get-by-element-...', Array)
#21 /var/www/html/vendor/craftcms/cms/src/web/Application.php(349): yii\base\Module->runAction('element-relatio...', Array)
#22 /var/www/html/vendor/craftcms/cms/src/web/Application.php(650): craft\web\Application->runAction('element-relatio...', Array)
#23 /var/www/html/vendor/craftcms/cms/src/web/Application.php(311): craft\web\Application->_processActionRequest(Object(craft\web\Request))
#24 /var/www/html/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest(Object(craft\web\Request))
#25 /var/www/html/web/index.php(12): yii\base\Application->run()
#26 {main} {"memory":5013552,"exception":"[object] (yii\\base\\InvalidConfigException(code: 0): Invalid owner ID: 3746 at /var/www/html/vendor/craftcms/cms/src/base/NestedElementTrait.php:158)"}
Craft CMS version: 5.2.1
Element Relations version: 3.0.2.2
PHP version: 8.2.19
We've noticed searches and asset list pages seem a lot slower now that we've got the plugin running. We've got probably over a thousand images in a bunch of folders. Does your plugin cache the data once it looks up the relations? I know caching is one of the big issues in programming, but wonder if it could be stored until the asset is selected, viewed, edited? Just an idea
We're using Element Relations on a site with Craft Commerce products and would love to be able to show relations for different elements associated with product elements.
Any plans to get Element Relations updated for Craft 5 soon?
In a Craft multisite install, occasionally entries in the admin will get an error when trying to render the data from the Relations field type when present. It doesn't happen all the time, but when it does it breaks the entry editing and page formatting heavily.
Error: Call to a member function setTimezone() on bool in /home/forge/rogc.websitepreview.dev/vendor/internetztube/craft-element-relations/src/controllers/ElementRelationsController.php:29 Stack trace: #0 [internal function]: internetztube\elementRelations\controllers\ElementRelationsController->actionGetByElementId() #1 /home/forge/rogc.websitepreview.dev/vendor/yiisoft/yii2/base/InlineAction.php(57): call_user_func_array() #2 /home/forge/rogc.websitepreview.dev/vendor/yiisoft/yii2/base/Controller.php(178): yii\base\InlineAction->runWithParams() #3 /home/forge/rogc.websitepreview.dev/vendor/yiisoft/yii2/base/Module.php(552): yii\base\Controller->runAction() #4 /home/forge/rogc.websitepreview.dev/vendor/craftcms/cms/src/web/Application.php(305): yii\base\Module->runAction() #5 /home/forge/rogc.websitepreview.dev/vendor/craftcms/cms/src/web/Application.php(606): craft\web\Application->runAction() #6 /home/forge/rogc.websitepreview.dev/vendor/craftcms/cms/src/web/Application.php(284): craft\web\Application->_processActionRequest() #7 /home/forge/rogc.websitepreview.dev/vendor/yiisoft/yii2/base/Application.php(384): craft\web\Application->handleRequest() #8 /home/forge/rogc.websitepreview.dev/web/index.php(12): yii\base\Application->run() #9 {main}
When using ElementRelations with LinkVault it breaks the plugin. If I disabled ElementRelations plugin then LinkVault works.
In the logs I see the following:
2022-11-24 08:12:15 [web.INFO] [yii\db\Connection::open] Opening DB connection: mysql:host=127.0.0.1;dbname=cr_site;port=3306 {"memory":4632416}
2022-11-24 08:12:15 [web.INFO] [nystudio107\codeeditor\CodeEditor::bootstrap] CodeEditor module bootstrapped {"memory":7262344}
2022-11-24 08:12:15 [web.INFO] [modules\site\Site::init] Site module loaded {"memory":7278592}
2022-11-24 08:12:15 [web.INFO] [presseddigital\linkit\Linkit::init] Linkit plugin loaded {"memory":7785544}
2022-11-24 08:12:15 [web.INFO] [vaersaagod\matrixmate\MatrixMate::init] MatrixMate plugin loaded {"memory":7878728}
2022-11-24 08:12:15 [web.INFO] [wrav\oembed\Oembed::init] oEmbed plugin loaded {"memory":7916016}
2022-11-24 08:12:15 [web.INFO] [nystudio107\retour\Retour::init] Retour plugin loaded {"memory":7977416}
2022-11-24 08:12:15 [web.INFO] [nystudio107\seomatic\Seomatic::init] SEOmatic plugin loaded {"memory":8354632}
2022-11-24 08:12:15 [web.INFO] [yii\web\Session::open] Session started {"memory":8450208}
2022-11-24 08:12:15 [web.ERROR] [yii\base\ErrorException:2] yii\base\ErrorException: Attempt to read property "id" on null in /site/vendor/internetztube/craft-element-relations/src/ElementRelations.php:97
Stack trace:
#0 /sitevendor/craftcms/cms/src/web/ErrorHandler.php(79): yii\base\ErrorHandler->handleError(2, 'Attempt to read...', '/site/D...', 97)
#1 /site/vendor/internetztube/craft-element-relations/src/ElementRelations.php(97): craft\web\ErrorHandler->handleError(2, 'Attempt to read...', '/site/D...', 97)
#2 [internal function]: internetztube\elementRelations\ElementRelations->internetztube\elementRelations\{closure}(Object(craft\events\Model
So somehow ElementRelations is triggered there while trying download a file.
Craft version: 4.3.3
Plugin version: 2.0.2
LinkVault version: 4.0.1
I have run into a specific scenario, when entry is in use, it shouldn't be unpublished (or deleted).
I have installed this plugin, so editors can check, if there are related entries. ANd they are informed that they should not unpublish such entries. It works until they don't forgot.
Feature request: when ElementRelations field shows entry's relations, changing entry's status (or deleting) would show a warning to the editor? Or maybe dissallow these operations? Is there any chance for such functionality?
Make a change to your own user preferences and click save.
Preferences should be saved
An exception is thrown
yii\base\ErrorException: Undefined variable $job in /app/vendor/internetztube/craft-element-relations/src/ElementRelations.php:83
Stack trace:
#0 {main}
The issue is that the plugin is trying to push a variable $job
to the queue, but $job
hasn't been defined.
PHP version 8.1 (also present with 7.4.26)
Craft Pro 3.7.39
Element Relations 1.3.5
Maybe it's a good idea to show the Relations as a Table with more information like:
Title
Related Site
Section
or Volume
or Product Type
Element Type
(Asset, Entry, etc.)
Related field
(on which field is this relation)
Maybe this gives a bit more info/context when you search for something special.
This is kind of a weird one, and I haven't been able to produce super consistent repro steps, but as I'm working on a site build it seems almost every time I leave the tab I have my CP in, move over to a different browser tab, and come back to the CP later, there's an Element Relations task stuck in the queue until I either reload the page or click on the item going directly to the queue, then it quickly runs and goes away.
I would be tempted to think this is a strange Craft bug, but it doesn't happen with any other plugins/tasks I've noticed. And more often than not, whenever I log into the CP of a site with this plugin installed, Element Relations tasks are running and quickly resolve once I load the CP. Like they are for some reason unable to run properly in the background/without a control panel load to trigger them to complete.
Does this make any sense? It's kind of a tricky one to describe/narrow down, but only seems to happen with this plugin.
Craft CMS: v4.1.0.2
Element Relations: v2.0.0
Hi - I'm getting lots of errors as per the following:
TypeError: internetztube\elementRelations\services\CacheService::getElementRelationsCached(): Argument #1 ($elementId) must be of type int, null given, called in /srv/app/*******/htdocs/vendor/internetztube/craft-element-relations/src/controllers/ElementRelationsController.php on line 23 and defined in /srv/app/mobkitchen-prod/htdocs/vendor/internetztube/craft-element-relations/src/services/CacheService.php:24
Stack trace:
#0 /srv/app/*******/htdocs/vendor/internetztube/craft-element-relations/src/controllers/ElementRelationsController.php(23):
Any ideas what might cause it, or do you need more details from me?
We followed your directions to install the Elements Relations plugins and added the Relations field to our Assets sub-folder. Once I added the field to the subfolder in Assets, I viewed the Assets page and received an error pictured below. I also clicked into one of the Assets and the error appears on that page as well.
The number of elements with a relations
field does not match when a section has multiple entry types.
Hi!
I'm struggling to get anywhere with this plugin unfortunately. While I can get the jobs to create, none of them are actually run even though all other jobs run as normal.
I reduced the bulk job size down to 1 but all of them remain at 0% progress.
When viewing an individual entry, the element relations field never seems to update: I just see a spinner.
Development does run, but extremely slowly.
Any ideas on how I can debug?
Hey, the plugin seems to ignore elements that are linked within drafts.
We are using this plugin so we can see if an asset is linked in any entry before we delete it.
Now if an asset is linked in an unpublished draft, it still shows the asset is "unused", which is problematic because it is in fact used and should not be deleted.
Do you think you can change this, so relations in drafts get checked as well?
Craft 3.7.46
craft-element-relations: 1.3.7
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.