machour / yii2-notifications

A complete notifications module for your Yii 2 powered application
MIT License
90 stars 48 forks source link

notification effects other widget json data #49

Open ajkosh opened 6 years ago

ajkosh commented 6 years ago

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 commented 6 years ago

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

ajkosh commented 6 years ago

@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 commented 6 years ago

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

ajkosh commented 6 years ago

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 commented 6 years ago

I don't see how this module can be responsible for the problem you're facing. Could you publish a repository reproducing the problem?

On Jan 4, 2018 14:40, "ajkosh" notifications@github.com wrote:

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; } ],

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/machour/yii2-notifications/issues/49#issuecomment-355284539, or mute the thread https://github.com/notifications/unsubscribe-auth/AASlQvkjo92xlCl4dtu2Rq_CUadSxiUTks5tHNTcgaJpZM4RSoco .

ajkosh commented 6 years ago

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 commented 6 years ago

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

ajkosh commented 6 years ago

@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 commented 6 years ago

For what URL?

ajkosh commented 6 years ago

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

ajkosh commented 6 years ago

@machour Did you try this with yii2 admin.

machour commented 6 years ago

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

ajkosh commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@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 commented 6 years ago

@machour i did nt touch vendor notification code

machour commented 6 years ago

You will have to in order to find the problem