Media wiki merge and delete a user using MergeUser extension - mediawiki

Hi i am trying to install the MergeUser plugin in media wiki. My account is in both sysop and bureaucrat. I have enabled $wgGroupPermissions['bureaucrat']['usermerge'] = true;
When i try to access /Special:UserMerge i get the following error
[70aadcac] /index.php/Special:UserMerge Exception from line 376 of /var/www/plivowiki/includes/SpecialPage.php: Call to undefined method UserMerge::getPageTitle
Backtrace:
#0 /var/www/plivowiki/extensions/UserMerge/UserMerge_body.php(128): SpecialPage->__call(string, array)
#1 /var/www/plivowiki/extensions/UserMerge/UserMerge_body.php(128): UserMerge->getPageTitle()
#2 /var/www/plivowiki/includes/SpecialPage.php(631): UserMerge->execute(NULL)
#3 /var/www/plivowiki/includes/SpecialPageFactory.php(488): SpecialPage->run(NULL)
#4 /var/www/plivowiki/includes/Wiki.php(298): SpecialPageFactory::executePath(Title, RequestContext)
#5 /var/www/plivowiki/includes/Wiki.php(602): MediaWiki->performRequest()
#6 /var/www/plivowiki/includes/Wiki.php(467): MediaWiki->main()
#7 /var/www/plivowiki/index.php(49): MediaWiki->run()
#8 {main}

You need to either upgrade MediaWiki, or downgrade the MergeUser extension. The function SpecialPage::getPageTitle was introduced recently (it was called SpecialPage::getTitle before).
If you can't upgrade MediaWiki to the latest version, a possible patch would be to replace getPageTitle with getTitle in /extensions/UserMerge/UserMerge_body.php, but of there could still be other incompatibilities.
Also, please give the versions of the relevant software and extensions when asking this type of questions, that will make it much easier to give good answers.
Edit: I see now that this has been answered before: UserMerge Error

Related

Codeception handle expected UserException

Running a function test as below for an application in Yii2 framework.
public function checkEmptyToken2(FunctionalTester $I)
{
$I->amOnRoute('site/verify-email', ['token' => '']);
$I->canSee('Email verify token did not come through for some reason');
}
Results in an error as below.
Codeception PHP Testing Framework v4.2.1
Powered by PHPUnit 8.5.27
Frontend\tests.functional Tests (1) -------------------------------------------------------------------------------------------------------------------------------------------------------------
E VerifyEmailCest: Check empty token2 (0.01s)
-------------------------------------------------------------------------------------------------------------------------------------------------------------
1) VerifyEmailCest: Check empty token2
Test tests/functional/VerifyEmailCest.php:checkEmptyToken2
[yii\base\UserException] Email verify token did not come through for some reason.
You can either copy/paste the verification email again OR
request a new verification email from the Login page.
Scenario Steps:
1. $I->amOnRoute("site/verify-email",{"token":""}) at tests/functional/VerifyEmailCest.php:41
#1 /data/www/frontend/models/VerifyEmailForm.php:38
#2 /data/www/frontend/controllers/SiteController.php:345
#3 frontend\controllers\SiteController->actionVerifyEmail
#4 /data/www/vendor/yiisoft/yii2/base/InlineAction.php:57
#5 /data/www/vendor/yiisoft/yii2/base/Controller.php:178
#6 /data/www/vendor/yiisoft/yii2/base/Module.php:552
#7 /data/www/vendor/yiisoft/yii2/web/Application.php:103
#8 /data/www/vendor/symfony/browser-kit/Client.php:405
#9 Codeception\Module\Yii2->amOnRoute
#10 /data/www/frontend/tests/_support/_generated/FunctionalTesterActions.php:661
Time: 718 ms, Memory: 16.00 MB
There was 1 error:
---------
ERRORS!
Tests: 1, Assertions: 0, Errors: 1.
I expect the error to be exactly that! All I want Codeception to do is to simply ignore it and move on so I can check for the error text in "canSee". I tried using try/catch statement and that results in a different error. Tried using "expectException" and that did not work either.
The codeception module will only handle subclasses of yii\web\HttpException as part of the normal request flow.
If you are throwing a yii\base\UserException then the status code will always be 500 as it is for any other exception.
While I doubt that throwing UserExceptions that do not extend the HttpException the Yii error handler supports it. I'll update the codeception module to support it as well.

Magento 2 : Exception #0 (Exception): Recoverable Error:

I have moved one magento 2 website from one server to another, after configuration, I got below error on category pages:
1 exception(s):
Exception #0 (Exception): Recoverable Error: Argument 1 passed to Mageplaza\Core\Helper\AbstractData::__construct() must be an instance of Magento\Framework\App\Helper\Context, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /SOME_PATH/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /SOME_PATH/app/code/Mageplaza/Core/Helper/AbstractData.php on line 56
Exception #0 (Exception): Recoverable Error: Argument 1 passed to Mageplaza\Core\Helper\AbstractData::__construct() must be an instance of Magento\Framework\App\Helper\Context, instance of Magento\Framework\ObjectManager\ObjectManager given, called in /SOME_PATH/vendor/magento/framework/ObjectManager/Factory/AbstractFactory.php on line 93 and defined in /SOME_PATH/app/code/Mageplaza/Core/Helper/AbstractData.php on line 56
I have tried below things to resolve above:
Reindexing
Re-save category pages from backend
Created new category, and found its page working fine.
It seems there is a problem with database where old category urls need to be reindexed/rewritten or processed some way.
Can anyone help me to resolve this or any guide how I can troubleshoot this further?
Any help is appreciated!
Thanks
Deleting var/di directory resolves the problem. I didn't need to run any CLI command nor I need to do any cache clear stuff!

Controller file was loaded but class does not exist?

I am having trouble getting around this error in Magento:
"Controller file was loaded but class does not exist". (Full stack at bottom).
I am essentially trying to follow this tutorial: http://phpshiner.blogspot.in/2012/09/simple-custom-payment-module-part-1.html in magento.
I am having trouble finding good documentation on Magento in general, and I am very new at it...
can anyone provide some common causes, advice, or insight? I am swamped, googled this for hours, check permissions and file structure. You name it.
Trace:
#0 C:\Apache24\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(326): Mage::exception('Mage_Core', 'Controller file...')
#1 C:\Apache24\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(293): Mage_Core_Controller_Varien_Router_Standard->_includeControllerClass('C:\Apache24\htd...', 'Mage_Checkout_O...')
#2 C:\Apache24\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Standard.php(196): Mage_Core_Controller_Varien_Router_Standard->_validateControllerClassName('Mage_Checkout', 'onepage')
#3 C:\Apache24\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(176): Mage_Core_Controller_Varien_Router_Standard->match(Object(Mage_Core_Controller_Request_Http))
#4 C:\Apache24\htdocs\magento\app\code\core\Mage\Core\Model\App.php(354): Mage_Core_Controller_Varien_Front->dispatch()
#5 C:\Apache24\htdocs\magento\app\Mage.php(683): Mage_Core_Model_App->run(Array)
#6 C:\Apache24\htdocs\magento\index.php(87): Mage::run('', 'store')
#7 {main}
Check your controller class name is correct ?
I also got that error when I was using WinSCP.
Problem is that my file was not saved correctly.
When I have saved it again and then reload my page and error was gone.
Maybe this will help you.
If not able to locate the issue.
Please go there(Standard.php)
Mage_Core_Controller_Varien_Router_Standard
In this function please add like this and execute the page.
protected function _includeControllerClass($controllerFileName, $controllerClassName)
{
echo $controllerFileName."#############".$controllerClassName;
echo "<br/>";
You will get the issue module and location
Thanks
Annadurai

CakePHP: How to deploy DB schema changes to production without errors

We're running CakePHP v2.3
We just had a weird incident during a push to production where we threw the following errors immediately after pulling the changes and we were not able to load any pages. The column (User.group_id) had just been dropped by us. We then deleted the caches (persistent and models) thinking that would prevent errors resulting from the changed schema. Instead, the caches were not recreated and it generated the following error and we were not able to load any pages...
2013-09-27 07:53:05 Error: [PDOException] SQLSTATE[42S22]: Column not found: 1054 Unknown column 'User.group_id' in 'field list'
Request URL: /admin
Stack Trace:
#0 /home/username/public_html/lib/Cake/Model/Datasource/DboSource.php(459): PDOStatement->execute(Array)
#1 /home/username/public_html/lib/Cake/Model/Datasource/DboSource.php(425): DboSource->_execute('SELECT `User`.`...', Array)
#2 /home/username/public_html/lib/Cake/Model/Datasource/DboSource.php(669): DboSource->execute('SELECT `User`.`...', Array, Array)
#3 /home/username/public_html/lib/Cake/Model/Datasource/DboSource.php(1080): DboSource->fetchAll('SELECT `User`.`...', false)
#4 /home/username/public_html/lib/Cake/Model/Model.php(2674): DboSource->read(Object(User), Array)
#5 /home/username/public_html/lib/Cake/Model/Datasource/DboSource.php(598): Model->find('first', Array)
#6 /home/username/public_html/lib/Cake/Model/Model.php(799): DboSource->query('findById', Array, Object(User))
#7 /home/username/public_html/app/Controller/AppController.php(95): Model->__call('findById', Array)
#8 /home/username/public_html/app/Controller/AppController.php(95): User->findById('12')
#9 /home/username/public_html/lib/Cake/Controller/Component/Auth/ControllerAuthorize.php(64): AppController->isAuthorized('12')
#10 /home/username/public_html/lib/Cake/Controller/Component/AuthComponent.php(409): ControllerAuthorize->authorize('12', Object(CakeRequest))
#11 /home/username/public_html/lib/Cake/Controller/Component/AuthComponent.php(335): AuthComponent->isAuthorized('12')
#12 [internal function]: AuthComponent->startup(Object(PagesController))
#13 /home/username/public_html/lib/Cake/Utility/ObjectCollection.php(131): call_user_func_array(Array, Array)
#14 [internal function]: ObjectCollection->trigger(Object(CakeEvent))
#15 /home/username/public_html/lib/Cake/Event/CakeEventManager.php(247): call_user_func(Array, Object(CakeEvent))
#16 /home/username/public_html/lib/Cake/Controller/Controller.php(670): CakeEventManager->dispatch(Object(CakeEvent))
#17 /home/username/public_html/lib/Cake/Routing/Dispatcher.php(183): Controller->startupProcess()
#18 /home/username/public_html/lib/Cake/Routing/Dispatcher.php(161): Dispatcher->_invoke(Object(PagesController), Object(CakeRequest), Object(CakeResponse))
#19 /home/username/public_html/app/webroot/index.php(97): Dispatcher->dispatch(Object(CakeRequest), Object(CakeResponse))
#20 {main}
After some scrambling, we switched the debug mode from 0 (production) to 2 (development) and this caused the caches to be recreated and the pages to load properly. We then switched it back to 0 and everything remained fine.
So in the aftermath of this incident, we have a two-part question:
Why did this happen? We tested this procedure on our local dev server, although we were probably in debug mode 2 the whole time.
What is the correct way to push CakePHP code updates with corresponding schema changes to production? Up until recently, most of our schema changes have been additions, so it was safe to manually add the tables / fields to the production DB prior to pulling the new code. But with "breaking" changes that remove tables / fields used by the current code, this is not an option.
{From here: https://stackoverflow.com/questions/3402246/cache-file-model-cakephp/}
Inside the app/tmp/cache/ folder is models. This is the cached schema of your tables. This had the reference to the field that was removed from your table.
My correct way: I clear out the models folder whenever I have schema changes. You could just remove the one file representing the table if you are worried about slowing down your server when it needs to rebuild your caches.

Qt / thread event loop QTimer/MySQL queries

I am coding an application on Mac OS X / Qt.
I have a thread with an event loop. In this thread I make MySQL queries each tick (called by a qtimer).
Randomly my application crashes with the following backtrace:
#0 0x00e27acd in QMutex::lock ()
#1 0x00f5842d in QMetaObjectPrivate::connect ()
#2 0x00f5897f in QObject::connect ()
#3 0x0134c230 in QMYSQLResult::QMYSQLResult ()
#4 0x0134c2d9 in QMYSQLDriver::createResult ()
#5 0x0006daae in QSqlDatabase::exec ()
What can be the problem?
You should ensure that you setup the MySQL connection from the same thread as you perform the MySQL queries from.