News:

SMF 2.1.4 has been released! Take it for a spin! Read more.

Main Menu

Only variables should be passed by reference

Started by jvter, March 23, 2022, 10:04:24 AM

Previous topic - Next topic

jvter

Hi,
I had to move the forum unexpectedly. I now get,  when I click on the admin link, the following error:

"Unsupported operand types: string - int"

Looking in the databse I find the following: 'Only variables should be passed by reference'

I've installed a mod for this part (do not remember the name of the mod). I can not remove it in the normal way because cannot access the admin part. Is there anaothe solution?

Doug Heffernan

Quote from: jvter on March 23, 2022, 10:04:24 AMHi,
I had to move the forum unexpectedly. I now get,  when I click on the admin link, the following error:

"Unsupported operand types: string - int"

Looking in the databse I find the following: 'Only variables should be passed by reference'

I've installed a mod for this part (do not remember the name of the mod). I can not remove it in the normal way because cannot access the admin part. Is there anaothe solution?

If you go inside the Packages folder you will see a folder there called backups. Inside it there will be zip packages containing forum files that mods have edited when installed, prefixed with the date of installation and the name of the mod. Find the one you installed last, upload it to your pc, unzip it and reupload the contents to the root of your forum directory and select the overwrite option.

Another way is to overwrite your forum files with those from the large 2.0.19 package, minus the upgrade files. But doing this will uninstall all the mods that you have installed and undo any manual edits that you might have done to the files.

Arantor

Alternatively, what file and lime is it saying this error for? Maybe we can solve the actual problem.

jvter

#3
Quote from: Arantor on March 23, 2022, 11:11:45 AMAlternatively, what file and lime is it saying this error for? Maybe we can solve the actual problem.

A clean installation can solve this. But I loose a lot.
How can I find which file is causing the error? The only information I get is the link itself: "https://domain.name/forum/index.php?action=admin"

Arantor

The error log doesn't give you a file and a line number?

jvter

Quote from: Arantor on March 24, 2022, 09:47:29 AMThe error log doesn't give you a file and a line number?
Ah yes I see it now:

D:/www/Domain.name/www/Forum/Sources/lm_source/resources/hooks.php
Line 37

That line reads: "$desired = end(array_keys($admin_areas['config']['areas'])) - 1;"


Doug Heffernan

Quote from: jvter on March 24, 2022, 08:53:08 AMA clean installation can solve this. But I loose a lot.

FYI, the first method that I outlined above, will not cause the loss of all mods btw. It will simply undo all the edits that the latest mod did, which as per your post caused the error.

Arantor

Try changing that line to

$keys = array_keys($admin_areas['config']['areas']);
$desired = end($keys) - 1;

Also reverting the code will leave the hook still being referenced in the database and possibly triggering other errors.

Advertisement: