Mediawiki: own Extension Specialpage - missing alias - php

I just tried to make my own wiki-extension following these tut: Mediawiki - Develop Extensions
The Extensions has a SpecialPage and when i visist the mediawiki - SpecialPages Site i get the following error:
[cb6b6dfb1a33d10f07bcbc44] /index.php/Spezial:Spezialseiten Wikimedia\Assert\ParameterAssertionException from line 63 of D:\Wiki\mediawiki\wiki\vendor\wikimedia\assert\src\Assert.php: Bad value for parameter $dbkey: should not be empty
Backtrace:
#0 D:\Wiki\mediawiki\wiki\includes\title\TitleValue.php(82):Wikimedia\Assert\Assert::parameter(boolean, string, string)
#1 D:\Wiki\mediawiki\wiki\includes\specialpage\SpecialPage.php(100): TitleValue->__construct(integer, string, string)
#2 D:\Wiki\mediawiki\wiki\includes\specialpage\SpecialPage.php(84): SpecialPage::getTitleValueFor(string, boolean, string)
#3 D:\Wiki\mediawiki\wiki\includes\specialpage\SpecialPage.php(629): SpecialPage::getTitleFor(string, boolean)
#4 D:\Wiki\mediawiki\wiki\includes\specials\SpecialSpecialpages.php(70): SpecialPage->getPageTitle()
#5 D:\Wiki\mediawiki\wiki\includes\specials\SpecialSpecialpages.php(42): SpecialSpecialpages->getPageGroups()
#6 D:\Wiki\mediawiki\wiki\includes\specialpage\SpecialPage.php(522): SpecialSpecialpages->execute(NULL)
#7 D:\Wiki\mediawiki\wiki\includes\specialpage\SpecialPageFactory.php(576): SpecialPage->run(NULL)
#8 D:\Wiki\mediawiki\wiki\includes\MediaWiki.php(283): SpecialPageFactory::executePath(Title, RequestContext)
#9 D:\Wiki\mediawiki\wiki\includes\MediaWiki.php(851): MediaWiki->performRequest()
#10 D:\Wiki\mediawiki\wiki\includes\MediaWiki.php(512): MediaWiki->main()
#11 D:\Wiki\mediawiki\wiki\index.php(43): MediaWiki->run()
#12 {main}
with the Debug-notice:
Notice: Did not find alias for special page ''. Perhaps no aliases are defined for it? [Called from SpecialPageFactory::getLocalNameFor in D:\Wiki\mediawiki\wiki\includes\specialpage\SpecialPageFactory.php at line 691] in D:\Wiki\mediawiki\wiki\includes\debug\MWDebug.php on line 311
So why does it search for an empty alias '' when trying to build my SpecialPage?
Could sth gone wrong with my MyExtensions.i18n.alias.php?
or Does any1 know if this kind of error has a deeper meening?

It sounds like an issue with the definition of your special page alias.
Make sure your alias for your SpecialPage is defined correctly, and that the alias page itself is properly attached in your extension in 'ExtensionMessagesFiles' (so it's being read).
See https://www.mediawiki.org/wiki/Manual:Special_pages#The_aliases_file for more information.
Also, you can use https://tools.wmflabs.org/mwstew/ tool to create an extension boilerplate with your special page name and alias generated for you.

Related

QRCODE: index invalid or out of range in laravel blade

So my route is defined as:
Route::get('dashboard/upgrade/invoice/{code}',[PackageController::class,'invoice'])->name('user.invoice');
The visited url is:
https://examplewebsite.com/dashboard/upgrade/invoice/3SInyM0RwGkKz2vSYsqLxlfsL
now this url sometimes open without any error.
other times, it returns 500 SERVER ERROR
When I checked my laravel.log to see why, I see:
production.ERROR: Index invalid or out of range {"view":{"view":"/home/xx/xx/resources/views/dashboard/upgrade/invoice.blade.php","data":[]},"userId":xx,"exception":"[object] (Spatie\\LaravelIgnition\\Exceptions\\ViewException(code: 0): Index invalid or out of range at /home/fewflyok/xxx/vendor/bacon/bacon-qr-code/src/Encoder/MaskUtil.php:134)
on the blade template, I have the qrcode line called with:
{!! QrCode::color(34, 27, 114)->size(150)->generate($invoice->address ) !!}
Now I want I am not using the bacon-qr-code on this particular blade. I have a different qrCode package (SimpleSoftwareIO) which I already set up on my config/app.
I then discover that the stacktrace traces to the qrcode I am using. So here is an extended log:
[stacktrace]
#0 xx/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php(197): BaconQrCode\\Encoder\\MaskUtil::applyMaskPenaltyRule3()
#1 xxx/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php(244): BaconQrCode\\Encoder\\Encoder::calculateMaskPenalty()
#2 xxx/vendor/bacon/bacon-qr-code/src/Encoder/Encoder.php(135): BaconQrCode\\Encoder\\Encoder::chooseMaskPattern()
#3 xxx/vendor/bacon/bacon-qr-code/src/Writer.php(54): BaconQrCode\\Encoder\\Encoder::encode()
.
.
#4 xxx/vendor/simplesoftwareio/simple-qrcode/src/Generator.php(171): BaconQrCode\\Writer->writeString()
#5 xxx/resources/views/dashboard/upgrade/invoice.blade.php(31): SimpleSoftwareIO\\QrCode\\Generator->generate()
.
.
#6 xxx/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(109): require('/home/fewk/...')
#7 xxx/vendor/laravel/framework/src/Illuminate/Filesystem/Filesystem.php(110): Illuminate\\Filesystem\\Filesystem::Illuminate\\Filesystem\\{closure}()
#8 xxx/vendor/laravel/framework/src/Illuminate/View/Engines/PhpEngine.php(58): Illuminate\\Filesystem\\Filesystem->getRequire()
#9 xx/vendor/laravel/framework/src/Illuminate/View/Engines/CompilerEngine.php(61): Illuminate\\View\\Engines\\PhpEngine->evaluatePath()
#10 xxx/vendor/laravel/framework/src/Illuminate/View/View.php(139): Illuminate\\View\\Engines\\CompilerEngine->get()
Have a look at https://github.com/Bacon/BaconQrCode/issues/92
seems it's related to php8.1 opcache and jit=tracing
switching to jit=function helps...

Call to undefined method Illuminate\Database\Query\Builder::getEntityAttribute()

I have this strange issue.
It was not happening before and after I pulled form github ,
when I send json responses and send and eloquent object with it, it gives me this error. Presumably when the model gets serialized.
I've tried to parse it with json_encode but still the same issue.
I don't know whats going on , is it the issue of the json_encode or a problem with the eloquent model.It's related to all the models because all of them return the same error when i try to parse them to json.
It was ok before but now I don't know what went wrong.
I've compared commits to see the differences but still no luck.
I could not find anything that might have caused this issue so I'm guessing it is the fault of an nontracked file so I reinstalled the dependencies again through composer install still no luck.
When I reverse to the last commit it works fine so the theory of the untracked files is rubish.
Has anyone have any idea ?
I'm going nuts over this.
This is the stacktrace form when it starts to convert to json :
[2018-04-18 14:22:53] local.ERROR: Call to undefined method Illuminate\Database\Query\Builder::getEntityAttribute() {"exception":"[object] (BadMethodCallException(code: 0): Call to undefined method Illuminate\\Database\\Query\\Builder::getEntityAttribute() at /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Query/Builder.php:2483)
[stacktrace]
#0 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Builder.php(1288): Illuminate\\Database\\Query\\Builder->__call('getEntityAttrib...', Array)
#1 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(1470): Illuminate\\Database\\Eloquent\\Builder->__call('getEntityAttrib...', Array)
#2 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(438): Illuminate\\Database\\Eloquent\\Model->__call('getEntityAttrib...', Array)
#3 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(450): Illuminate\\Database\\Eloquent\\Model->mutateAttribute('entity', NULL)
#4 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(109): Illuminate\\Database\\Eloquent\\Model->mutateAttributeForArray('entity', NULL)
#5 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(970): Illuminate\\Database\\Eloquent\\Model->attributesToArray()
#6 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Support/Collection.php(1611): Illuminate\\Database\\Eloquent\\Model->toArray()
#7 [internal function]: Illuminate\\Support\\Collection->Illuminate\\Support\\{closure}(Object(App\\AdminActivity))
#8 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Support/Collection.php(1612): array_map(Object(Closure), Array)
#9 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(237): Illuminate\\Support\\Collection->toArray()
#10 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(970): Illuminate\\Database\\Eloquent\\Model->relationsToArray()
#11 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Concerns/HasAttributes.php(237): Illuminate\\Database\\Eloquent\\Model->toArray()
#12 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(970): Illuminate\\Database\\Eloquent\\Model->relationsToArray()
#13 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Database/Eloquent/Model.php(999): Illuminate\\Database\\Eloquent\\Model->toArray()
#14 [internal function]: Illuminate\\Database\\Eloquent\\Model->jsonSerialize()
#15 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php(71): json_encode(Array, 0)
#16 /home/marlind/PhpstormProjects/ital-restaurant/vendor/symfony/http-foundation/JsonResponse.php(50): Illuminate\\Http\\JsonResponse->setData(Array)
#17 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Http/JsonResponse.php(31): Symfony\\Component\\HttpFoundation\\JsonResponse->__construct(Array, 200, Array)
#18 /home/marlind/PhpstormProjects/ital-restaurant/vendor/laravel/framework/src/Illuminate/Routing/ResponseFactory.php(83): Illuminate\\Http\\JsonResponse->__construct(Array, 200, Array, 0)
#19 /home/marlind/PhpstormProjects/ital-restaurant/app/Http/Controllers/BaseController.php(19): Illuminate\\Routing\\ResponseFactory->json(Array)
#20 /home/marlind/PhpstormProjects/ital-
I assume you have a problem with getting custom attribute. You can do that in a model by writing get{name}Attribute. You didn't provide us with any code so it's hard to point an error.
Old question but found it when searching for a problem I encountered.
Given that the stack trace is similar to mine I think the information and solution I found could shed more light on the matter.
Here's a link to Laravel's documentation about mutators as array:
https://laravel.com/docs/9.x/eloquent-mutators#array-object-and-collection-casting
For me the problem was when doing ->toArray() on a model that had attribute mutators.
Solved it by adding the following to the model:
protected $casts = [
'entity' => AsArrayObject::class,
];

Sql error in Cakephp2 FindBy statement, getting a 1064 syntax error

*EDIT: Its findBy, thank you to the commenter who corrected me"
So Im running a server script in Cakephp 2 that handles information in the "Bonuses" area of the app.
$objAccount = $this->Account->FindById($Bonus['Account']['id']);
Theres the exact code that sends the error off. Its in the BonusesComponent, which otherwise works.
</pre>Error: SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'FindById' at line 1
#0 /var/www/secondcake/lib/Cake/Model/Datasource/DboSource.php(436): PDOStatement->execute(Array)
#1 /var/www/secondcake/lib/Cake/Model/Datasource/DboSource.php(403): DboSource->_execute('FindById', Array)
#2 /var/www/secondcake/lib/Cake/Model/Datasource/DboSource.php(646): DboSource->execute('FindById', Array, Array)
#3 /var/www/secondcake/lib/Cake/Model/Datasource/DboSource.php(588): DboSource->fetchAll('FindById', Array, Array)
#4 /var/www/secondcake/lib/Cake/Model/Model.php(776): DboSource->query('FindById', Array, Object(Account))
#5 /var/www/secondcake/app/Controller/Component/BonusesComponent.php(525): Model->__call('FindById', Array)
#6 /var/www/secondcake/app/Controller/Component/BonusesComponent.php(525): Account->FindById('83')
#7 /var/www/secondcake/app/Console/Command/CronTradeBonusesShell.php(24): BonusesComponent->EndBonus(Array)
#8 /var/www/secondcake/app/Console/Command/CronTradeBonusesShell.php(10): CronTradeBonusesShell->EndTradeBonuses()
#9 /var/www/secondcake/app/Console/Command/cronBase.php(105): CronTradeBonusesShell->cronMain()
#10 /var/www/secondcake/lib/Cake/Console/Shell.php(389): CronBase->main()
#11 /var/www/secondcake/lib/Cake/Console/ShellDispatcher.php(177): Shell->runCommand(NULL, Array)
#12 /var/www/secondcake/lib/Cake/Console/ShellDispatcher.php(69): ShellDispatcher->dispatch()
#13 /var/www/secondcake/app/Console/cake.php(33): ShellDispatcher::run(Array)
Heres the stack trace.
Just to add, if anyone has any ideas about why this is doing this, I'd be very grateful. The FindBy methods work fine all over the app.
Your issue was because you had a typo in the function call.
CakePHP2 use a magic function __call to map any call to model. If you take a look at Model::__call you can see that it send the function name to every behavior to see if one behavior has a corresponding function. If the function does not exist, it send it directly to the data source as a request.
If you get a SQL Error in CakePHP2 with a query corresponding to the name of a function, you may want to directly check that you did not mistype the function name.

AnchorCMS installation fails

When I've gone through the installation steps for Anchor CMS, I'm getting an error (after final step):
Uncaught Exception
Undefined variable: vars
Origin
install/routes.php on line 183
Trace
#0 /home/.../anchor-cms/install/routes.php(183): System\error::native(8, 'Undefined varia...', '/home/...', 183, Array)
#1 [internal function]: {closure}()
#2 /home/.../anchor-cms/system/route.php(165): call_user_func_array(Object(Closure), Array)
#3 /home/.../anchor-cms/system/router.php(158): System\route->run()
#4 /home/.../anchor-cms/system/start.php(46): System\router->dispatch()
#5 /home/.../anchor-cms/install/index.php(33): require('/home/...')
#6 {main}
Any suggestions? I'm running Linux 64bit (elementaryOS).
You may have already resolved this, but the way I got around this was to remove the undefined variable from line 183 of the install/routes.php file completely.
return Layout::create('account' $vars);
So it then looked like this:
return Layout::create('account');
Refreshing the page will then allow you to create an account and login to the admin interface etc.

Zend - plugin Word_CamelCaseToDash was not found in the registry

There is many topics like that all over the internet, but because i have NO IDEA what to do with answers i must ask it again.
I was transferring website from one server to another and after transfer i saw:
exception 'Zend_Loader_PluginLoader_Exception' with message 'Plugin by name 'Word_CamelCaseToDash' was not found in the registry; used paths:
Zend_Filter_: Zend/Filter/' in /library/Zend/Loader/PluginLoader.php:412
Stack trace:
#0 /library/Zend/Filter/Inflector.php(518): Zend_Loader_PluginLoader->load('Word_CamelCaseT...')
#1 /library/Zend/Filter/Inflector.php(411): Zend_Filter_Inflector->_getRule('Word_CamelCaseT...')
#2 /library/Zend/Filter/Inflector.php(311): Zend_Filter_Inflector->addFilterRule(':module', Array)
#3 /library/Zend/Controller/Action/Helper/ViewRenderer.php(281): Zend_Filter_Inflector->addRules(Array)
#4 /library/Zend/Controller/Action/Helper/ViewRenderer.php(381): Zend_Controller_Action_Helper_ViewRenderer->getInflector()
#5 /library/Zend/Controller/Action/Helper/ViewRenderer.php(469): Zend_Controller_Action_Helper_ViewRenderer->_getBasePath()
#6 /library/Zend/Controller/Action/Helper/ViewRenderer.php(516): Zend_Controller_Action_Helper_ViewRenderer->initView()
#7 /library/Zend/Controller/Action/HelperBroker.php(253): Zend_Controller_Action_Helper_ViewRenderer->init()
#8 /library/Zend/Controller/Action.php(132): Zend_Controller_Action_HelperBroker->__construct(Object(ErrorController))
#9 /library/Zend/Controller/Dispatcher/Standard.php(262): Zend_Controller_Action->__construct(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http), Array)
#10 /library/Zend/Controller/Front.php(954): Zend_Controller_Dispatcher_Standard->dispatch(Object(Zend_Controller_Request_Http), Object(Zend_Controller_Response_Http))
#11 /index.php(39): Zend_Controller_Front->dispatch()
#12 {main}
Honestly i have no skill in Zend, so if anyone could tell me what is wrong with it? (website worker on previous hosting without a problem).
A file named CamelCaseToDash.php under Word directory is missing check that file first.
If the file exist than check in your configuration file whether the autoloadnamespace is for Word is added

Categories