Fatal error when checking role_exists()

Discussion forum for Extension Writers regarding Extension Development.
Post Reply
User avatar
kinerity
Registered User
Posts: 1097
Joined: Mon Sep 01, 2014 1:00 am
Name: Kailey Truscott
Contact:

Fatal error when checking role_exists()

Post by kinerity » Sun Sep 24, 2017 4:27 am

I'm hoping that I'm just missing something obvious here. I have code in my migration file that checks if a role exists. This works fine in one of my other extensions, but it's not working in my best answer extension. Relevant code is here (currently commented out). If I try to enable the extension with this code in place, I get a blank page and the error below in my server's error_log.
Got error 'PHP message: PHP Fatal error: Uncaught Error: Call to undefined method kinerity\\bestanswer\\migrations\\v10x\\release_0_0_1::role_exists() in /ext/kinerity/bestanswer/migrations/v10x/release_0_0_1.php:66
I do have use \phpbb\db\migration\container_aware_migration; and the release_0_0_1 class extends \phpbb\db\migration\container_aware_migration (lines 13 and 15 in the same file linked above).
Image

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

Re: Fatal error when checking role_exists()

Post by kasimi » Sun Sep 24, 2017 9:07 am

role_exists() is not a core method. :) https://github.com/kinerity/knowledgeba ... #L198-L214

User avatar
canonknipser
Registered User
Posts: 1130
Joined: Thu Sep 08, 2011 4:16 am
Location: Germany
Name: Frank Jakobs
Contact:

Re: Fatal error when checking role_exists()

Post by canonknipser » Sun Sep 24, 2017 10:14 am

There was a discussion a while ago with a similar problem, with a solution by Paul: viewtopic.php?f=461&t=2418706&hilit=role

Edit: He added the function to his migration: https://github.com/paul999/mention/blob ... hp#L40-L55 ;)
Greetings
Frank
phpbb.de support team member
English is not my native language
New arrival - Extensions and scripts for phpBB
no support via PM or mail

User avatar
kinerity
Registered User
Posts: 1097
Joined: Mon Sep 01, 2014 1:00 am
Name: Kailey Truscott
Contact:

Re: Fatal error when checking role_exists()

Post by kinerity » Sun Sep 24, 2017 1:30 pm

kasimi wrote:
Sun Sep 24, 2017 9:07 am
role_exists() is not a core method. :) https://github.com/kinerity/knowledgeba ... #L198-L214
Well f#$& :oops: Thanks!
Image

Post Reply

Return to “Extension Writers Discussion”

Who is online

Users browsing this forum: No registered users and 12 guests

cron