croxton / Stash

Stash allows you to stash text and snippets of code for reuse throughout your templates.
GNU General Public License v3.0
197 stars 20 forks source link

Stash 3.1.0 does not work on EE7 #179

Closed willowlight closed 1 year ago

willowlight commented 1 year ago

I get this on any page using Stash...

syntax error, unexpected 'array' (T_ARRAY), expecting function (T_FUNCTION) or const (T_CONST)

user/addons/stash/models/stash_model.php:14

Stack Trace: Please include when reporting this error

0 user/addons/stash/mod.stash.php(64): EE_Loader->model('stash_model')

1 ee/legacy/libraries/Template.php(1737): Stash->__construct()

2 ee/legacy/libraries/Template.php(1474): EE_Template->process_tags()

3 ee/legacy/libraries/Template.php(615): EE_Template->tags()

4 ee/legacy/libraries/Template.php(247): EE_Template->parse('{!-- ra:0000000...', false, 8, false)

5 ee/legacy/libraries/Template.php(177): EE_Template->fetch_and_parse('', Array, false)

6 ee/legacy/libraries/Core.php(805): EE_Template->run_template_engine('', '')

7 ee/legacy/controllers/ee.php(53): EE_Core->generate_page()

8 [internal function]: EE->index()

9 ee/ExpressionEngine/Core/Core.php(268): call_user_func_array(Array, Array)

10 ee/ExpressionEngine/Core/Core.php(124): ExpressionEngine\Core\Core->runController(Array)

11 ee/ExpressionEngine/Boot/boot.php(184): ExpressionEngine\Core\Core->run(Object(ExpressionEngine\Core\Request))

12 dev.ehrintelligence.com/index.php(175): require_once('...')

12 dev.ehrintelligence.com/index.php(175): require_once('...')

croxton commented 1 year ago

Which version of PHP are you using?

willowlight commented 1 year ago

7.2.34

croxton commented 1 year ago

It looks like PHP 7.2 support was broken in a recent commit. I've restored compatibility, please download the latest version and let me know if that's working for you. https://github.com/croxton/Stash/archive/refs/heads/master.zip

willowlight commented 1 year ago

Thanks, works great. Just so you know, mustache has the same issue . . .

croxton commented 1 year ago

@willowlight would you mind opening an issue over there? Please include a stack trace or error notices. Many thanks. https://github.com/croxton/Mustash/issues