GithubHelp home page GithubHelp logo

wrav / related Goto Github PK

View Code? Open in Web Editor NEW
5.0 5.0 4.0 300 KB

A simple plugin that adds a widget within the Craft CP page sidebar, allowing you to quickly and easily access related entries.

License: MIT License

PHP 78.85% Twig 21.15%

related's People

Contributors

aberkie avatar jdsdev avatar reganlawton avatar shoogland avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

related's Issues

Composer deprecation notice

Deprecation Notice: Class wrav\related\assetbundles\Related\RelatedAsset located in ./vendor/wrav/related/src/assetbundles/related/RelatedAsset.php does not comply with psr-4 autoloading standard. It will not autoload anymore in Composer v2.0. in phar:///usr/local/bin/composer/src/Composer/Autoload/ClassMapGenerator.php:185

Any plans to make this work with Assets too ?

Would be a amazing if this would work with assets too and show you which pages as asset is used/related to.
Not sure if this is viable, but would be a great addition if it is....

Uniquely different from Element Map?

Hey Regan,

Congrats on the plugin release. I was just wondering how different this plugin is from Element Map: https://plugins.craftcms.com/element-map

I can see that the way you present the relationships is different... but beyond that? Do you have a roadmap that would take it down a different path?

If not, perhaps you'd consider being a contributor to EM instead (I'm not the maintainer there but who would turn down help?!). I think the community is better served when there are less + higher quality plugins.

Cheers,
John

Innacurate relationships showing in Craft 3.9.10

We're seeing some entries related to each other where there is no actual relation. The entries in question share some Title and Slug similarities with other entries that are related, but they have unique entry IDs, so should not be showing in the list.

I don't know how to detail this issue further. Please let me know what level of detail you would need to support.

Feature Request: Include users in related data

It would be great if you could include the ability to see any relationships with users too.
I currently have a field in users that relates to some entries and on those entries it would be great if I could see the related users.

Potential Speed Improvement

It seems that this plugin loads the relationships in and then, after the relationships are returned, updates the UI to display the "View" link. I'm working on a site that has several million relationships and it's causing the initial "View" link to take upwards of 60 seconds to load. Would it be possible to have the View link load in to the page immediately with an indicator that work is happening. Right now our editors aren't sure if it's working (in the background) or if something is broken while they wait for the link to appear.

getElementTypeById errors

I get several of these errors in my log, seems to be related to when entries have assets and the assets are related to the entry.

TypeError: craft\services\Elements::getElementTypeById(): Argument #1 ($elementId) must be of type int, string given, called in /home/tsvg/public_html/nhd/vendor/wrav/related/src/controllers/DefaultController.php on line 68

havent dug deeper as it appears to be working but just seen lots of errors in log related to this plugin.

Scope to all sites

The calls to find() in RelatedService.php don't currently search all sites. So if for example you have a multi-site setup and want to view related elements for a user, some items may not show up.

A quick fix would be to do find()->site('*') however there may be cases where you may want to only show related items for the current site, or have a setting to limit which sites are included.

Craft4?

Hi, any chance of getting this updated to support craft 4?

Craft4 - 403 on trying to fetch relations

Currently all non superAdmin users will not be able to see the relations because the following URL cannot be reached due to missing permissions:

/admin/related/default?id=51814&sectionId=&userId=&categoryId=

if this route is changed to

/actions/related/default?id=51814&sectionId=&userId=&categoryId=

it does work. Could a change be made to Related.js to use /actions instead of /admin?

Please let me know! Our client really loves this widget and would like to continue using it.

Thanks in advance!

Expired/Pending items showing the live icon (green circle) when viewing the relationships

Hey @reganlawton, I was checking the previous update and I noticed a slight bug that I thought I would mention if you have time to correct it. That is when you view the related entries, the little coloured circle is not reflecting the status of the actual entry/user/category. Instead these always show as live (green circle).

If an entry is not published then it does show correctly as a draft icon.

I have attached some screenshots, but they don't that show much or illustrate that well.
I have tested with both expired and pending items and they both show as live.

The outline item is actually expired
Screenshot 2021-03-29 at 09 20 54

Non published entries show ok.
Screenshot 2021-03-29 at 09 24 07

Thanks.

Not working when related field is in a matrix field

Hello,
First, I'd like to thank you for this plugin which looks great and useful but unfortunately does not work in my case.
I have a related field inside a matrix. Unfortunately, I always have a "View (0)" link that appears in the sidebar.
Would it be possible to make it work when the related is in a matrix ?
Also I'm on Craft CMS 3.3.20.1.

Possible issue with action path url in Related.js

Thank you for this plugin, it's a massive help for our editors.

I'm hitting an issue using this plugin on a site which uses HTTPS. Works fine on local and staging which are HTTP.

When I load an entry within the CP, I see this error in the console:

Mixed Content: The page at 'https://www.domain.com/admin/entries/entry-section/985810-entry-title' was loaded over HTTPS, but requested an insecure XMLHttpRequest endpoint 'http://www.domaincom/actions/related/default/?id=985810&sectionId=37&userId=&categoryId='. This request has been blocked; the content must be served over HTTPS.

The action URL is using HTTP rather than HTTPS. The site is a pretty standard setup โ€“ base URL settings in .env are using HTTPS, .htaccess isn't doing anything with https, there are no plugins like Patrol running, and it's a LetsEncrypt SSL cert.

I can get around this error by setting editing line 28 in Related.js to:

url: "/admin/actions/related/default?id=" + id + "&sectionId=" + sectionId + "&userId=" + userId + "&categoryId=" + categoryId,

Note the addition of '/admin' at the start. This doesn't feel like a proper fix, maybe just a nice coincidence, so I didn't want to open a PR.

I'm wondering if this URL should be set to something else? E.g. currently it also doesn't respect Craft's actionTrigger setting.

Thanks for any pointers.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.