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

REQ: no "you're not allowed to do this action" #344

Closed
punkyard opened this issue Dec 4, 2022 · 2 comments · Fixed by #348
Closed

REQ: no "you're not allowed to do this action" #344

punkyard opened this issue Dec 4, 2022 · 2 comments · Fixed by #348
Assignees
Labels

Comments

@punkyard
Copy link

punkyard commented Dec 4, 2022

Hi
any user without rights to manage content in a calendar will receive this message each time they'll click somewhere in a blank frame/cell.

For a smoother experience, would it be possible to receive no message, no action in return to a simple click in the cell of a day when a user has no permission to create or edit events?

@punkyard punkyard changed the title "you're not allowed to do this action" REQ: no "you're not allowed to do this action" Dec 4, 2022
@yurabakhtin yurabakhtin self-assigned this Dec 19, 2022
@yurabakhtin
Copy link
Collaborator

@luke- I confrim there was the bug.
Fixed in PR #348.

The problem was because the JS object FullCalendar options are initialized from data attributes, but if some data attribute is passed as boolean false then such html attribute is not rendered at the html element at all, see yii\helpers\BaseHtml::renderTagAttributes():

if (is_bool($value)) {
    if ($value) {
        $html .= " $name";
    }
}

So I just converted all boolean data options into integer format so now they are rendered like data-can-create="0" and the JS object FullCalendar is initialized with proper options.

@luke-
Copy link
Contributor

luke- commented Dec 20, 2022

@yurabakhtin Great thanks!

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

Successfully merging a pull request may close this issue.

3 participants