TryGhost / Ghost

Independent technology for modern publishing, memberships, subscriptions and newsletters.
https://ghost.org
MIT License
47.16k stars 10.26k forks source link

Issue with '@page.show_title_and_feature_image is not used' error #17745

Closed fueko closed 1 year ago

fueko commented 1 year ago

Issue Summary

Hello πŸ‘‹

My latest version of the Reiro theme includes the aforementioned @page.show_title_and_feature_image helper, added in the post.hbs file, as below:

Zrzut ekranu 2023-08-17 o 00 17 01

Unfortunately, despite this, many users experience an error when activating the theme. On my side, such an error no longer appears (localhost installation) and scan using GScan - gives no errors. So I am unable to answer why users continue to experience this error, despite the presence of a helper.

So I am not able to give the steps for reproduction for this case. Therefore (if there is no solution) could I ask you to remove this error from GScan?

Reason: This error relates to the Beta editor feature which is not yet an official release, this is a 'error' not a 'warning' which makes it all the more worrying for users (a lot of users don't even know that it is possible to activate the new Beta editor). Additionally when the helper is not used in a theme, there is already a nice message in the editor that explains why this function cannot be used:

Zrzut ekranu 2023-08-17 o 00 28 01

It seems to me that at this stage (Beta) this information is sufficient. So given the above, I would ask the Ghost team to consider removing the error message πŸ™

Steps to Reproduce

Unfortunately, I do not know the exact circumstances why the error appears in some users, despite the fact that it is used in the theme.

Ghost Version

5.59.1

Node.js Version

v18.17.0

How did you install Ghost?

localhost

Database type

SQLite3

Browser & OS version

No response

Relevant log / error output

No response

Code of Conduct

9larsons commented 1 year ago

Hey @fueko, to clarify, the @page global should only be referenced within the page.hbs file or its partials. It should not be used within post.hbs.

As for the gscan error, users need to both update Ghost and their Reiro theme in order to not see the error.

The theme error should only show in admin (the red box in the sidebar) when it's not the only warning. If it's the only warning, we don't show the box and users should only see the message in the Post editor sidebar.

Could you provide some more details on what users are seeing with their error?

fueko commented 1 year ago

Hi @9larsons! Thank you for your reply.

My themes do not use the page.hbs file because, according to the Ghost documentation, it is not mandatory and in this case the post.hbs file is used (and I am not in favor of duplicating files if it is not necessary):

Zrzut ekranu 2023-08-21 o 18 53 53

Could you provide some more details on what users are seeing with their error?

There is no confirmation but I can suspect that it is an error displayed as a pop-up when theme is activated. Also as I mentioned no error is no longer visible with me when I added it to the theme, GScan also does not return any error.

So I understand that this helper works with pages, but for the past few years the post.hbs file has acted as a replacement for the page.hbs file, which was not mandatory. So will this be fixed as it was before (by which I mean that it is correct to use this helper anywhere, be it in the final post.hbs or page.hbs application)?

9larsons commented 1 year ago

Ah, understood - thanks for reminding me of that! There's only a few cases users should be seeing:

We can certainly improve the error message to mention that a Ghost upgrade is necessary, although that'll require a Ghost upgrade to be visible anyways. It would be helpful to know what specific error message they are seeing in case there's something else going on here.

I'll get a commit pushed to gscan today.

fueko commented 1 year ago

Thanks for your explanation! I understand that the communique about the error may have been a boundary situation.

At this point, however, I'm more interested in the correctness of using this helper, because as I mentioned I use post.hbs files instead of page.hbs as well as custom-[name].hbs (which are common for post and pages in the current Ghost structure).

My question, then, is whether I can use (and it is correct?) this helper in the partial files that the post.hbs as well as custom-[name].hbs files ultimately use (GScan detects this as correct without reporting a problem as well as the function of hiding the title worked correctly).

We can certainly improve the error message to mention that the issue only applies if using the Beta editor

The message should not appear when the theme is installed as @javierencalada mentioned in https://github.com/TryGhost/Ghost/issues/17777

@9larsons thanks so much for all your help!

fueko commented 1 year ago

@9larsons This is the message 'sometimes' received by users (hosted on Ghost(Pro)) who update the theme to the latest version:

0

I will add that Basho has the mentioned helper and GScan does not show anything, so I do not know why it appears for some users.

Zrzut ekranu 2023-08-23 o 15 01 35

9larsons commented 1 year ago

And to answer your other question, it's fine to use this in page.hbs right now. The check in gscan isn't that specific, although it will return an error message saying it's missing from post.hbs.

9larsons commented 1 year ago

My page was a bit out of date, so I'm just seeing your new messages. I'm going to shoot you an email to the address you have in GitHub - I'll want to take a closer look at those sites and the theme, since that's unexpected given what you've said.

9larsons commented 1 year ago

The gscan changes were incorporated a few weeks ago with that last commit. I'm going to close this and please open a new issue if you feel there's necessary changes yet.