Element Relations Plugin for Craft CMS 3.x

Overview

Element Relations Plugin for Craft CMS 3.x

This plugin shows all relations of an element. For example, where an asset, entry or any other element is linked.

Feature Requests are welcome!

Share

Requirements

This plugin requires Craft CMS 3.0.0-beta.23 or later.

Installation

To install this plugin, follow these steps:

  1. Install with Composer via composer require internetztube/craft-element-relations
  2. Install plugin in the Craft Control Panel under Settings > Plugins

You can also install this plugin via the Plugin Store in the Craft Control Panel.

Screenshots

coming soon

Issues

Please report any issues you find to the Issues page.

Brought to you by Frederic Koeberl

Comments
  • No jobs are run in production, dev very slow

    No jobs are run in production, dev very slow

    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?

    CleanShot 2022-03-12 at 21 14 53@2x
    opened by howells 17
  • Adds Caching Layer and Console Comands

    Adds Caching Layer and Console Comands

    Boy howdy was this fun! Lots of learning and looking how other plugin greats do things.

    • Creates table on install or upgrade.
    • Adds command line/console commands to build or refresh the cache
    • Builds config/settings model to allow users to define cache duration
    • Dramatically speeds up the process for sites with lots of assets and content

    Should fix #3

    opened by gbowne-quickbase 6
  • Error `undefined index siteId` when refreshing data

    Error `undefined index siteId` when refreshing data

    Several developers on my team are getting undefined index siteId errors when they add an ElementRelations field to a new entrytype, or try to refresh the data at all image

    bug 
    opened by gbowne-quickbase 3
  • Allow illuminate/collections ^9.0 support

    Allow illuminate/collections ^9.0 support

    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.

    bug 
    opened by adrienne 3
  • Database error when installing and using plugin

    Database error when installing and using plugin

    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.

    Here is where I added the relations field: Screen Shot 2021-11-12 at 2 20 00 PM

    This is the view when I open the Assets folder: Screen Shot 2021-11-12 at 2 31 02 PM

    opened by cnoelqb 3
  • Fix error , if entry doesn't exist in primary site

    Fix error , if entry doesn't exist in primary site

    If an entry does not exist in the primary site (e.g. only in a second site), the request for the element requests with the wrong siteId (the siteId from the primary site). The request should also have the current siteId.

    opened by sfsmfc 1
  • getElementRelationsCached() TypeError

    getElementRelationsCached() TypeError

    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?

    opened by howells 1
  • [beta] Unable to create new entries on Craft 4 multi-site

    [beta] Unable to create new entries on Craft 4 multi-site

    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

    opened by turnstylerj 1
  • Bug: Unable to save my profile settings due to undefined $job variable

    Bug: Unable to save my profile settings due to undefined $job variable

    Steps to reproduce:

    Make a change to your own user preferences and click save.

    What I expect:

    Preferences should be saved

    What happens:

    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.

    System details

    PHP version 8.1 (also present with 7.4.26) Craft Pro 3.7.39 Element Relations 1.3.5

    opened by fantasticmachine 1
  • Redactor issue when viewing field: Getting unknown property: craft\redactor\Field::columnSuffix

    Redactor issue when viewing field: Getting unknown property: craft\redactor\Field::columnSuffix

    I'm trying to use the plugin on Craft 3.6.18 (I'm unable to update it right now, for various reasons) and get the attached error when viewing an element that has the field associated.

    I updated redactor to the latest version, but doesn't fix the issue.

    Any ideas where I'm going wrong?

    CleanShot 2022-03-08 at 13 06 53@2x

    opened by howells 1
  • Bug: Create Refresh Element Relations Cache Jobs fails

    Bug: Create Refresh Element Relations Cache Jobs fails

    Steps to reproduce:

    1. Go to Utilities > Element Relations
    2. Click Push Cache Refresh Job Into Queue button

    What I expect:

    The cache should rebuild in the background using the queue.

    What happens:

    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

    System details

    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

    Other notes

    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.

    opened by KatieMFritz 1
  • ElementRelations breaks LinkVault plugin

    ElementRelations breaks LinkVault plugin

    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

    opened by belkin 0
  • Fix: if only simple and no element relation found

    Fix: if only simple and no element relation found

    The pull request fix the problem, if we have only a simple relation in "relations" table, but no entry in "element_relations" table. The value $elementRelations (line 23) has a value !="|", but $dateUpdated is null, because CacheService::getDateUpdatedFromElementRelations only shows in the element_relations table.

    The problem only occurs, if you have an entry, that is not present in the default site group.

    opened by sfsmfc 0
  • FR: Add warning for Entry with relations when deleting or unpublishing. (changing status)

    FR: Add warning for Entry with relations when deleting or unpublishing. (changing status)

    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?

    enhancement 
    opened by lexislav 0
  • FR: Plugin does not track relations in draft

    FR: Plugin does not track relations in draft

    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

    enhancement 
    opened by lukasNo1 0
  • Element Relations task gets stuck in queue until CP page refreshed

    Element Relations task gets stuck in queue until CP page refreshed

    Description

    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.

    Screen Shot 2022-06-30 at 3 01 40 PM

    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.

    Additional Information

    Craft CMS: v4.1.0.2 Element Relations: v2.0.0

    bug 
    opened by turnstylerj 1
Releases(2.0.2)
Owner
Frederic Köberl
Senior Full-Stack Web Developer
Frederic Köberl
Plugin Vite is the conduit between Craft CMS plugins and Vite, with manifest.json & HMR support

Plugin Vite Related Articles: Vite.js Next Generation Frontend Tooling + Craft CMS A Vite Buildchain for Craft CMS Plugins Requirements Craft CMS 3.0.

nystudio107 8 Dec 30, 2022
Plugin for Craft CMS that makes it easy to interact with the Instagram Basic Display API and Instagram oEmbed.

Instagram Basic Display plugin for Craft CMS 3.x This plugin creates endpoints in your Craft install for you to consume the Instagram Basic Display AP

Jonathan Melville 5 Dec 20, 2022
Provides Twig template IDE autocomplete of Craft CMS & plugin variables

Autocomplete for Craft CMS 3.x Provides Twig template IDE autocompletion for Craft CMS and plugin/module variables and element types. Works with PhpSt

nystudio107 35 Dec 21, 2022
A plugin for Craft CMS 3.X that allows for GraphQL search functionality for matching on fields of nested entries.

Nested Entry GraphQL Plugin This Craft CMS plugin allows for performing graphQL search queries that match on fields on nested entries-as-a-field. What

Rubin EPO 2 Sep 10, 2021
Monet Plugin for Craft CMS

A Monet field can be added to asset elements which will generate and store an efficient placeholder image to be displayed inline, whilst the full asset is loading.

Chris Dyer 1 Jan 21, 2022
Generate a CMS element scaffolding within seconds.

Generate CMS elements or blocks Tired of creating the whole folder structure for a CMS block or element? With this plugin you can create the scaffoldi

Shape & Shift 26 Nov 4, 2022
A simple extension that adds the a CMS Edit link to an element that is inline-editable

SilverStripe Elemental Advanced Edit A simple extension that adds the a CMS Edit link to an element that is inline-editable. Created as work-around to

Robert van Lienden 5 Sep 19, 2022
Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond.

About Craft CMS Craft is a flexible, user-friendly CMS for creating custom digital experiences on the web and beyond. It features: An intuitive, user-

Craft CMS 2.9k Jan 1, 2023
Allows the use of the Vite.js next generation frontend tooling with Craft CMS

Vite plugin for Craft CMS 3.x Allows the use of the Vite.js next generation frontend tooling with Craft CMS Related Article: Vite.js Next Generation F

nystudio107 38 Dec 30, 2022
Provides autocompletion for Craft CMS and plugins in Twig templates.

Autocomplete for Craft CMS Provides autocompletion for Craft CMS and plugins in Twig templates. Currently works with PhpStorm only, as VSCode does not

PutYourLightsOn 12 Nov 23, 2021
A BlurHash implementation for Craft CMS.

BlurHash plugin for Craft CMS 3.x Render a BlurHash from a given asset in Craft CMS. A BlurHash is a compact representation of a placeholder for an im

Dodeca Studio 8 Nov 12, 2022
Edit richt text content in Craft CMS using Article by Imperavi.

Article Editor About the plugin This plugin brings the powerful Article Editor from Imperavi to Craft CMS, allowing you to make create beautiful rich

Creativeorange 6 Mar 30, 2022
Provides a twig editor field with Twig & Craft API autocomplete

Twigfield for Craft CMS 3.x & 4.x Provides a twig editor field with Twig & Craft API autocomplete Requirements Twigfield requires Craft CMS 3.0 or 4.0

nystudio107 13 Nov 1, 2022
Botble plugin comment is a comment plugin for Botble CMS

Botble plugin comment This is a plugin for Botble CMS so you have to purchase Botble CMS first to use this plugin.

Bảo Bối 27 Nov 25, 2021
Flextype is an open-source Hybrid Content Management System with the freedom of a headless CMS and with the full functionality of a traditional CMS

Flextype is an open-source Hybrid Content Management System with the freedom of a headless CMS and with the full functionality of a traditional CMS. Building this Content Management System, we focused on simplicity. To achieve this, we implemented a simple but powerful API's.

Flextype 524 Dec 30, 2022
PHPVibe Open source video CMS / Video Sharing CMS / Youtube Api v3 / Video Embeds

PHPVibe Video CMS Free Video Sharing CMS The modern choice of design inspired by Youtube and a social videos sharing module that may just cut it for y

MediaVibe 71 Dec 18, 2022
NukeViet 132 Nov 27, 2022
BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the project website for more information.

BaiCloud-cms About BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the

null 5 Aug 15, 2022
Baicloud CMS is a lightweight content management system (CMS) based on PHP and MySQL and running on Linux, windows and other platforms

BaiCloud-cms About BaiCloud-cms is a powerful open source CMS that allows you to create professional websites and scalable web applications. Visit the

null 5 Aug 15, 2022