Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #4679: Unable to set customview path for relation list #4680

Merged
merged 1 commit into from
Dec 10, 2019

Conversation

zoomyboy
Copy link

This addresses the issue that it should be possible to set a custom view path for a relation. The relation list is rendered inside of the form of the parent and generally has another "meaning" than the normal table which is rendered by default. So setting a custom view path for that relation list is probably a good option.

I set this to null by default because no path meansis's just not added to the ViewPath of the list widget:

Backend\Widgets\Lists:213

        $this->recordsPerPage = $this->getUserPreference('per_page', $this->recordsPerPage);

        if ($this->showPagination == 'auto') {
            $this->showPagination = $this->recordsPerPage && $this->recordsPerPage > 0;
        }

        if ($this->customViewPath) {
            $this->addViewPath($this->customViewPath);
        }

        $this->validateModel();
        $this->validateTree();

If the view Path is null, the list just behaves as before - meaning the config value isn't set at all.

@LukeTowers
Copy link
Contributor

@zoomyboy can you also make a PR to the docs repo (octobercms/docs) documenting this?

@LukeTowers
Copy link
Contributor

Fixes #4679

@zoomyboy
Copy link
Author

octobercms/docs#409

@zoomyboy zoomyboy changed the title Fix #4679 Fix #4679: Unable to set customview path for relation list Oct 10, 2019
@github-actions
Copy link

github-actions bot commented Dec 4, 2019

This pull request will be closed and archived in 3 days, as there has been no activity in the last 30 days. If this is still being worked on, please respond and we will re-open this pull request.

@bennothommo bennothommo added this to the v1.0.461 milestone Dec 4, 2019
@daftspunk daftspunk merged commit d4d1874 into octobercms:develop Dec 10, 2019
@daftspunk
Copy link
Member

Thanks @zoomyboy!

@mjauvin
Copy link
Contributor

mjauvin commented Dec 13, 2019

@daftspunk @LukeTowers aszbanas-extremecoding Is that documented somewhere ?

@LukeTowers
Copy link
Contributor

@mjauvin here: octobercms/docs#409

@mjauvin
Copy link
Contributor

mjauvin commented Dec 14, 2019 via email

@LukeTowers
Copy link
Contributor

@mjauvin @daftspunk might have to update the docs site for it to show up

@mjauvin
Copy link
Contributor

mjauvin commented Dec 14, 2019

@LukeTowers never mind, it's already in the docs, I thought that was a new option in the relation config file:

https://octobercms.com/docs/backend/relations#configuring-relation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

6 participants