HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Has Messages been deprecated and replaced by Pockets?

I lost ability of seeing the Messages for some two vf versions now.

I have tried every thing, another browser, cleared cookies, brand new latest install and still cannot get the messages to show on any page.

Has Pockets been made to replace it?

I am talking about what we still see on this forum


Comments

  • KasparKaspar Moderator

    Messages still works, added some last week - on vf 3.1

  • Perhaps it's a CSS issue?

  • no trace of the html in the source, cleaned out all the css, all the plugins, switched to most basic theme, scrubbed the vanilla core for what returns the messages. It has bugged me for so long, I was determined to find a cure all on my own, and have given up until I made this post :(


    Is there another config setting i am missing?

  • No config settings as far as I know. How does the db table GDN_Message look like, is there a "1" in the column "Enabled"? A simple test message looks like that in my db:


  • Yes, it's set.

    Here is what I have on a new install


  • There is one setting used. I wouldn't expect any changes if you delete it, but it surely wouldn't hurt. In the config.php you should be able to find some setting like that:

    $Configuration['Garden']['Messages']['Cache'] = array (
     0 => '[Base]',
    );
    


    Please note how that looks like for you, delete it and retry. If that helps, I would be interested in how it looked like.

  • This is the code that triggers if messages are shown or not:

           // Add Message Modules (if necessary)
           $messageCache = Gdn::config('Garden.Messages.Cache', []);
           $location = $sender->Application.'/'.substr($sender->ControllerName, 0, -10).'/'.$sender->RequestMethod;
           $exceptions = ['[Base]'];
    
           if (in_array($sender->MasterView, ['', 'default'])) {
               $exceptions[] = '[NonAdmin]';
           }
    
           // SignIn popup is a special case
           $signInOnly = ($sender->deliveryType() == DELIVERY_TYPE_VIEW && $location == 'Dashboard/entry/signin');
           if ($signInOnly) {
               $exceptions = [];
           }
    
           if ($sender->MasterView != 'admin' && !$sender->data('_NoMessages') && (val('MessagesLoaded', $sender) != '1' && $sender->MasterView != 'empty' && arrayInArray($exceptions, $messageCache, false) || inArrayI($location, $messageCache))) {
               $messageModel = new MessageModel();
               $messageData = $messageModel->getMessagesForLocation($location, $exceptions, $sender->data('Category.CategoryID'));
               foreach ($messageData as $message) {
                   $messageModule = new MessageModule($sender, $message);
                   if ($signInOnly) { // Insert special messages even in SignIn popup
                       echo $messageModule;
                   } elseif ($sender->deliveryType() == DELIVERY_TYPE_ALL)
                       $sender->addModule($messageModule);
               }
               $sender->MessagesLoaded = '1'; // Fixes a bug where render gets called more than once and messages are loaded/displayed redundantly.
           }
    

    This is from applications/dashboard/settings/class.hooks.php


    I would throw some decho(__LINE__); in the if clauses and the loop and see which part of the code is reached and which not

  • edited August 2019

    Thanks @R_J you have saved the day indeed. This nonsense has wasted my time for months ... the thing just suddenly stopped working. and I cannot tell why, because the factors involved seem controversial. I never deleted or saw that setting in all my dev work.

    And thanks for the settings/class.hooks.php reference, that helped me troubleblast this issue.

    This setting I placed in my config-defaults.php because it gets stripped out each time from the config.php

    without this setting Messages absolutely does not work as per my rigorous testing.

    $Configuration['Garden']['Messages']['Cache'] = array (
      0 => '[Base]',
    );
    


    Can someone confirm that the above setting gets stripped from config.php ?

    Phewww, I hoped this helps some similar poor soul. As I had given up already but kept on seeking just for the sake of finding a solution.

    My conclusion is to use Pockets (more stable and robust), and then roll your own cookie-based dismiss features.

  • charrondevcharrondev Vanilla Staff

    Could you file an issue on our core repo? This is the first I've seen it, but it would allow me to look into a bit. I've never seen that config set on my own machine. It's some really nasty look code though, I will say.

Sign In or Register to comment.