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

Error on page using shortcode #57

Closed
Nithilher opened this issue Jan 4, 2019 · 2 comments
Closed

Error on page using shortcode #57

Nithilher opened this issue Jan 4, 2019 · 2 comments

Comments

@Nithilher
Copy link

Just updated the shortcode-core plugin. After that, I get the following error on the one page where I make use of shortcode:

Argument 1 passed to Grav\Plugin\ShortcodeManager::getId() must implement interface Thunder\Shortcode\Shortcode\ShortcodeInterface, null given, called in /Users/phytzel/Sites/grav/user/plugins/shortcode-ui/shortcodes/AccordionsShortcode.php on line 33

The error page lists the following chunk from
/Users/phytzel/Sites/grav/user/plugins/shortcode-core/classes/ShortcodeManager.php


    /**
     * returns the shortcode of a specific hash
     * 
     * @param  string $hash       unique id of state
     * @return ShortcodeInterface shortcode stored for this hash
     */
    public function getStates($hash)
    {
        if (array_key_exists($hash, $this->states)) {
            return $this->states[$hash];
        }
    }
 
    /**
     * helper method to create a unique shortcode based on the content
     * 
     * @param  ShortcodeInterface $shortcode
     * @return string             
     */
    public function getId(ShortcodeInterface $shortcode)
    {
        return substr(md5($shortcode->getShortcodeText()), -10);
    }
 
    /**
     * Sets the current page context
     *
     * @param Page $page
     */
    public function setPage(Page $page)
    {

and highlights the line with getId().

It appears that the new shortcode-core does not work properly together with shortcode-ui.

Which further output should I provide?

@rhukster
Copy link
Member

rhukster commented Feb 1, 2019

Shortcode-ui problem. Will look there...

@rhukster
Copy link
Member

rhukster commented Feb 1, 2019

Related to this issue getgrav/grav-plugin-shortcode-ui#29

@rhukster rhukster closed this as completed Feb 1, 2019
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