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

notification effects other widget json data #49

Open
ajkosh opened this issue Jan 4, 2018 · 17 comments
Open

notification effects other widget json data #49

ajkosh opened this issue Jan 4, 2018 · 17 comments

Comments

@ajkosh
Copy link

ajkosh commented Jan 4, 2018

after installing your widget .in yii2 admin json data is is coming as raw html.
it is conflicting with other widget those are rendering json data .
yiiadmin

@machour
Copy link
Owner

machour commented Jan 4, 2018

Hi, please provide a little bit more information if you want some help :)

@ajkosh
Copy link
Author

ajkosh commented Jan 4, 2018

@machour
in yii2 admin rbac using render json data to listbox.
see here which is rendering json and code is there line no 16
https://github.com/mdmsoft/yii2-admin/blob/master/views/route/index.php

@machour
Copy link
Owner

machour commented Jan 4, 2018

and how did you configure the notifications module ? What url are you calling to get this JSON ?

@ajkosh
Copy link
Author

ajkosh commented Jan 4, 2018

i have module notification

'notifications' => [
            'class' => 'machour\yii2\notifications\NotificationsModule',
            // Point this to your own Notification class
            // See the "Declaring your notifications" section below
            'notificationClass' => 'app\modules\notification_manager\modules\core\models\Notification',
            // Allow to have notification with same (user_id, key, key_id)
            // Default to FALSE
            'allowDuplicate' => false,
            // Allow custom date formatting in database
            'dbDateFormat' => 'Y-m-d H:i:s',
            // This callable should return your logged in user Id
            'userId' => function() {
                return \Yii::$app->user->id;
            }
        ],

model code same as u mentioned in documentation .

@machour
Copy link
Owner

machour commented Jan 5, 2018 via email

@ajkosh
Copy link
Author

ajkosh commented Jan 17, 2018

even slim scroll also not working.
https://github.com/mdmsoft/yii2-admin/blob/master/views/route/index.php
here is line 16 showing json data.
ur poll action alse reflecting json data.
so if ur plugin is enable it shows raw json .

@machour
Copy link
Owner

machour commented Jan 17, 2018

@ajkosh again, I'm using this plugin along with others without any problems. Please set up a reproduce case if you want help

@ajkosh
Copy link
Author

ajkosh commented Jan 17, 2018

@machour when i implemented notificationmodule it is giving me permission error

{name: "Forbidden", message: "You are not allowed to perform this action.", code: 0, status: 403,…}
code
:
0
message
:
"You are not allowed to perform this action."
name
:
"Forbidden"
status
:
403
type
:
"yii\web\ForbiddenHttpException"

@machour
Copy link
Owner

machour commented Jan 17, 2018

For what URL?

@ajkosh
Copy link
Author

ajkosh commented Jan 17, 2018

@machour sorry forgot to mention url. for this
http://localhost/project/web/notifications/notifications/poll?seen=0

@ajkosh
Copy link
Author

ajkosh commented Jan 17, 2018

@machour Did you try this with yii2 admin.

@machour
Copy link
Owner

machour commented Jan 17, 2018

No I did not. It looks to me that you have an authorization problem. Check your yii2 admin configuration.

@ajkosh
Copy link
Author

ajkosh commented Jan 17, 2018

@machour i checked what when i m trying it is showing yii2 admin like this coz your notification module is enabled
https://user-images.githubusercontent.com/8582472/34552850-126ca7dc-f14a-11e7-845c-bf471d49a41b.png

@ajkosh
Copy link
Author

ajkosh commented Jan 17, 2018

@machour it has some error with yii2 admin.when your module enabled it shows json raw data and if i remove your module from config i cant give permission in rbac

@machour
Copy link
Owner

machour commented Jan 17, 2018

@ajkosh the Notification controller is a AJAX only controller. I think it's time you get your hands dirty by modifying the module code under vendor/machour/yii2-notifications/ to find the problem.

Try commenting out this line and see what happens: https://github.com/machour/yii2-notifications/blob/master/controllers/NotificationsController.php#L29
Maybe you'll see the error message you're missing out.

Also check your Yii2 error logs, etc ..

@ajkosh
Copy link
Author

ajkosh commented Feb 3, 2018

@machour i did nt touch vendor notification code

@machour
Copy link
Owner

machour commented Feb 3, 2018

You will have to in order to find the problem

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

No branches or pull requests

2 participants