service.yml Issue

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
guidetoacrazyworld
Registered User
Posts: 18
Joined: Tue Aug 06, 2019 7:40 pm

service.yml Issue

Post by guidetoacrazyworld » Fri Sep 13, 2019 8:39 pm

Okay talk to me like I'm an idiot. Every time I edit my services.yml file with an extension and load the extension my website crashes (all I get is a plane white screen on all pages). This happens even if I copy code that has previously worked. If I use the services.yml generated from the skeleton extension everything works fine.

Once this happens a clearing the cache will not recover. I have to delete the extension, I can then get into the customization menu, copy the extension back and disable it. If I return the original file unedited it works fine even when the code is the same.

This feels like an encoding issue, but I'm using UTF-8 without BOM. That seems to be what the generated file is. I'm using notepad++ to edit in windows. Am I losing my mind?

User avatar
kasimi
Extension Customisations
Extension Customisations
Posts: 3794
Joined: Sat Sep 10, 2011 7:12 pm
Location: Germany
Contact:

Re: service.yml Issue

Post by kasimi » Fri Sep 13, 2019 9:07 pm

Enable phpBB's debug mode or check your server error log.

guidetoacrazyworld
Registered User
Posts: 18
Joined: Tue Aug 06, 2019 7:40 pm

Re: service.yml Issue

Post by guidetoacrazyworld » Fri Sep 13, 2019 9:16 pm

Nothing in the server logs I wish it was that easy. But I'll give debug mode a try.

Just FYI you linked an article on rebuilding the config.php. I assume that was a mistake, but I'll look up debug mode. Never mind I'm an idiot, I see that the config.php is how you enable debug mode. Read before responding. Sorry about that.

Thank you for your help

User avatar
david63
Registered User
Posts: 16414
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: service.yml Issue

Post by david63 » Fri Sep 13, 2019 9:37 pm

Do you have any tab spacing in the file. yaml files can only have space characters and must be formatted correctly.

You can check your yaml syntax here - http://www.yamllint.com/
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

guidetoacrazyworld
Registered User
Posts: 18
Joined: Tue Aug 06, 2019 7:40 pm

Re: service.yml Issue

Post by guidetoacrazyworld » Fri Sep 13, 2019 9:54 pm

david63 wrote:
Fri Sep 13, 2019 9:37 pm
Do you have any tab spacing in the file. yaml files can only have space characters and must be formatted correctly.

You can check your yaml syntax here - http://www.yamllint.com/
Yeah, I made that mistake early on but it rejected the extension completely and throws an error. This happens even with 4 spaces per indentation.

User avatar
3Di
Former Team Member
Posts: 14071
Joined: Mon Apr 04, 2005 11:09 pm
Location: Milan (IT) Frankfurt (DE)
Name: Marco
Contact:

Re: service.yml Issue

Post by 3Di » Fri Sep 13, 2019 11:34 pm

Gist your file here: https://gist.github.com/ so we can have a look.
Please PM me only to request paid works. Thx.
Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user
Extensions, Scripts, MOD porting, Update/Upgrades
👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

rxu
Extensions Development Team
Posts: 2955
Joined: Wed Oct 25, 2006 12:46 pm
Location: Siberia, Russian Federation
Name: Ruslan
Contact:

Re: service.yml Issue

Post by rxu » Sat Sep 14, 2019 3:54 am

Also make sure you wrap service arguments with apostrophes, like

Code: Select all

        arguments:
            - '@config'
            - '@dbal.conn'
            - '@auth'

guidetoacrazyworld
Registered User
Posts: 18
Joined: Tue Aug 06, 2019 7:40 pm

Re: service.yml Issue

Post by guidetoacrazyworld » Sat Sep 14, 2019 4:07 am

Thanks for all your advice. I will have to take a look later. I tried again on my home computer tonight and enditing the file worked perfectly fine. So either I missed something or it's something related to editor settings on my work computer. Probably me missing something.

Post Reply

Return to “Extension Writers Discussion”