Sommerregen / grav-plugin-smileys

This plugin substitutes text emoticons, also known as smilies like :-), with images.
Other
3 stars 2 forks source link

Error while displaying unknown smiley #1

Closed tomzx closed 8 years ago

tomzx commented 9 years ago

Using the simple_smileys asset package.

Whoops\Exception\ErrorException thrown with message "Undefined index: D:<"

Stacktrace:
#10 Whoops\Exception\ErrorException in E:\grav\user\plugins\smileys\classes\Smileys.php:237
#9 Whoops\Run:handleError in E:\grav\user\plugins\smileys\classes\Smileys.php:237
#8 Grav\Plugin\Smileys:load in E:\grav\user\plugins\smileys\classes\Smileys.php:78
#7 Grav\Plugin\Smileys:__construct in E:\grav\user\plugins\smileys\smileys.php:118
#6 Grav\Plugin\SmileysPlugin:onPluginsInitialized in <#unknown>:0
#5 call_user_func in E:\grav\vendor\symfony\event-dispatcher\Symfony\Component\EventDispatcher\EventDispatcher.php:164
#4 Symfony\Component\EventDispatcher\EventDispatcher:doDispatch in E:\grav\vendor\symfony\event-dispatcher\Symfony\Component\EventDispatcher\EventDispatcher.php:53
#3 Symfony\Component\EventDispatcher\EventDispatcher:dispatch in E:\grav\vendor\rockettheme\toolbox\Event\src\EventDispatcher.php:23
#2 RocketTheme\Toolbox\Event\EventDispatcher:dispatch in E:\grav\system\src\Grav\Common\Grav.php:328
#1 Grav\Common\Grav:fireEvent in E:\grav\system\src\Grav\Common\Grav.php:181
#0 Grav\Common\Grav:process in E:\grav\index.php:31
Sommerregen commented 9 years ago

Strange, this shall not happen when using the simple_smileys asset package. Can you clear the cache and check that you placed the assets under user/data/smileys/simple_smileys and try again? If the error persist, Grav core was changing lately in a way I wasn't aware of. Can you give me a minimal working example then (the steps to get the error and the content of the md-file)?

tomzx commented 9 years ago

The minimal working example would be to create a content file with the following: :-) :D :'-( <3 (using the simple_smileys icon pack)

ohnonot commented 9 years ago

I just experienced the same, after clearing the cache. It happens all the time, even if there's no smileys on the page. the error looks like this:

Whoops \ Exception \ ErrorException (E_NOTICE)
Undefined index: D:<
Open: /var/www/html/user/plugins/smileys/classes/Smileys.php
      // Store acronym
      $smileys[strtolower($acronym)] = array(
        'acronym' => $acronym_escaped, 'html' => $html,
      );
       // Eventually auto-escape forbidden characters for the user
      if ($acronym != $acronym_escaped) {
        $smileys[$acronym_escaped] = $smileys[$acronym];
      }
    }

disabling your plugin via smileys.yaml makes the problem go away.

PS: sommerregen, I saw on gitter that you're into creating a native comment plugin. I would be very interested in this, too. maybe one of those can be integrated: https://github.com/datenstrom/yellow/issues/55#issuecomment-125040991 is there any code to start with? (i'm not using gitter, wasn't sure how to get into contact with you...)

Sommerregen commented 9 years ago

Hi @ohnonot ,

thanks for pointing me to this. At the moment I don't know how this happens and I will get to it this weekend. I just have/want to finish another update of my plugins. Due to my limited (spare) time I have to prioritze some plugins over others. I'm sorry, but I definitely will fix this.

Concerning creating a comment plugin, I'm waiting til the Admin plugin is released. The comment plugin will be a native plugin (no external services needed) and will be fully compatible with Grav (meaning it seemlessly integrates into the admin panel). As far as I know there is no code to start with, but I plan to use Gravs architecture on how it manages files.

If you want to get/stay in contact, you can either join Gitter, post a message in the Forum or E-Mail me. You can find my email address in the header of my plugin files (php).