Light Portal

Started by Bugo, March 25, 2020, 07:36:36 AM

Previous topic - Next topic

Bugo

Quoteit will be gone with the next update.
How did you come to that conclusion?

Before recommending this code to you, I tested it on my test setup and found no errors.

class Init
{
    public function __invoke(): void
    {
        if (defined('LP_NAME'))
            return;

        Utils::$context['lp_load_time'] ??= microtime(true);

kurapika

Quote from: Bugo on December 20, 2024, 05:25:39 AMHow did you come to that conclusion?
If the file is restored to its original state when the portal(*) is updated, my adjustment is gone. (or are there options like with WordPress using a child theme?)

QuoteBefore recommending this code to you, I tested it on my test setup and found no errors.
For me it is now the case that only certain users trigger these errors. I really don't know why that is. (As an admin, I didn't trigger the errors before.)


*) There is already a new version out there, but I don't yet know how to update the portal properly. Therefore I still have 2.8.1.

Bugo

Since I just received information about this error now, it's natural that the fix will only be added in the next version. But what's stopping you from updating to 2.8.2 and applying this fix manually right away? How to update is one of the most popular pages in the documentation, the link to which is available on every portal settings page.

If the update procedure differs from the standard one, I usually mention this in the notes of the announcement for the latest version in this topic.

In your specific case, it is enough to unpack the Themes and Sources folders from the archive of the latest version into the root of your forum, replacing the existing directories.

kurapika

Quote from: Bugo on December 20, 2024, 05:51:27 AMSince I just received information about this error now, it's natural that the fix will only be added in the next version
That's logical!
And the error is probably just mine, maybe I set something wrong or something.

Unfortunately I don't have an 'Upgrade' button.
Guess you have to download the latest package from https://custom.simplemachines.org/index.php?mod=4244 and then overwrite the files of the same name in \\Sources\\LightPortal?
But I don't know what I should do in the themes.

Quote from: Bugo on December 20, 2024, 05:51:27 AMthe most popular pages in the documentation,

Thanks! I'll work through this.

Bugo

After uploading the new package, you shouldn't click the "Install" button right away. Instead, return to the main page of the Package Manager, where all modifications are listed. Then you should see the "Upgrade" button if the currently installed version can be updated.

kurapika

The upgrade just worked!

But as suspected, my customization of Init.php is overwritten. But it doesn't matter, it didn't help anyway.

kurapika

#406
Apparently something went wrong though, because after I deleted the old package the site is dead.

No idea what I should do now?


The error message is:

Fatal error: Uncaught Error: Class "Bugo\LightPortal\Hooks\Init" not found in /www/htdocs/123456789/forum.example.com/Sources/LightPortal/Hooks/UserInfo.php:22 Stack trace: #0 /www/htdocs/123456789/forum.example.com/Sources/Subs.php(5766): Bugo\LightPortal\Hooks\UserInfo->__invoke() #1 /www/htdocs/123456789/forum.example.com/Sources/Load.php(954): call_integration_hook('integrate_user_...') #2 /www/htdocs/123456789/forum.example.com/index.php(218): loadUserSettings() #3 /www/htdocs/123456789/forum.example.com/index.php(188): smf_main() #4 {main} thrown in /www/htdocs/123456789/forum.example.com/Sources/LightPortal/Hooks/UserInfo.php on line 22

How can I fix this?

How do I uninstall the mod completely and without errors?

Bugo

There is a manual switcher to enable/disable the portal.

Or, just rename the Sources/LightPortal directory.

To remove the portal, if you are unable to do so through the package manager, it is sufficient to delete the folders Themes/default/LightPortal and Sources/LightPortal. In the database, you can delete the corresponding tables with the prefix {your_prefix}_lp_*.

kurapika

Quote from: Bugo on December 20, 2024, 07:53:50 AMThere is a manual switcher to enable/disable the portal.
That wasn't successful


QuoteOr, just rename the Sources/LightPortal directory.
That was the first thing I did, but without success


Quote... to delete the folders Themes/default/LightPortal and Sources/LightPortal.
That helped, I can even log in again as admin.

But I had to shut down the forum now. Because legally required menu entries such as data protection etc. are now missing (that was only implemented via the portal) And unfortunately other mods were also damaged as a result, various stylings are gone.

Bugo

Explain how other mods were affected if you only deleted the folders that I specified?

kurapika

Quote from: Bugo on December 20, 2024, 09:26:18 AMExplain how other mods were affected if you only deleted the folders that I specified?
I only deleted these two folders!
Maybe the toogle_portal script changed something? It didn't change the status of the portal (the WSOD remained), but it may have disrupted something else?

Bugo

All that script does is add or remove a hook that makes the portal work. It couldn't delete your mods or styles in any way. In any case, I can't see your forum and can't provide a more accurate assessment.

drfun

Hi Bugo,
Thank you for this wonderful portal, i recently noticed on my older version 2.6.0 that when admin and member login from the portal, once the login is successful, they are unable to see the portal element (IMAGES) displayed on the next page that loads, only links and text they can see, but before the login they are able to see. so i check the permission and i can see i have set everything right but i dont know why this is happen.

I then decided to upgrade to the latest version of the portal which is 2.8.2, but on installation, i got this error
QuoteDatabase Error: Unknown column 'slug' in 'INSERT INTO'
home/avvz/public_html/Packages/temp/database.php (Line 587)

when i checked on this support thread, i found out someone has already reported this at https://www.simplemachines.org/community/index.php?topic=572393.msg4176417;topicseen#msg4176417

But it was not resolved, although i tried the solution that was given by upgrading Optimus to 3.0 which i have done and i am still getting the error, my Optimus version is currently 3.0 RC1.

I decided to uninstall the optimus, and also drop all its table in the database, then try to install the latest version of the portal again but i got thesame error and the portal did not proceed to install.

Please how can i resolve this.
Thank you
ECLIKS - Metaverse & AI Tech Blog

Bugo

@drfun In your case, it would be better to upgrade step by step — first to 2.7, and then to 2.8.

You can find installers for older versions on GitHub. You need v2.7.0, and v2.8.0.

Don't forget to make backups! Even if you encounter errors during the upgrade, just ignore them. After updating to 2.8.0, you can then upgrade to 2.8.2.

In the worst-case scenario, if all these installers don't help, you can always check the current database structure in the database.php file within the package and make the necessary changes to your tables. Then, just extract the Sources and Themes directories from the archive to the root of your forum. However, a step-by-step upgrade is usually the better approach.

drfun

#414
Quote from: Bugo on December 21, 2024, 07:40:05 AM@drfun In your case, it would be better to upgrade step by step — first to 2.7, and then to 2.8.

You can find installers for older versions on GitHub. You need v2.7.0, and v2.8.0.

Don't forget to make backups! Even if you encounter errors during the upgrade, just ignore them. After updating to 2.8.0, you can then upgrade to 2.8.2.

In the worst-case scenario, if all these installers don't help, you can always check the current database structure in the database.php file within the package and make the necessary changes to your tables. Then, just extract the Sources and Themes directories from the archive to the root of your forum. However, a step-by-step upgrade is usually the better approach.
Thank you for your response. I tried the upgrade from older version as you said but still got thesame database error.
I decided to do a fresh  installation of smf 2.1.4 and i tried to insatll the light portal version 2.7, 2.7.1, 2.8, 2.8.1 and 2.8.2. Each gave me gave me the same error at various lines in the database. however 2.8.2 gave the error  below.
QuoteUnknown column 'slug' in 'INSERT INTO'
File: /home/vvz/public_html/Packages/temp/database.php
Line: 587
and could not install.
ECLIKS - Metaverse & AI Tech Blog

Bugo

To perform a fresh installation, you need to first delete the old tables in the database with the prefix {your_prefix}_lp_.

drfun

Quote from: Bugo on December 22, 2024, 12:22:46 AMTo perform a fresh installation, you need to first delete the old tables in the database with the prefix {your_prefix}_lp_.

Thank you bugo, I drop the old tables in the database and it installed perfectly without the error.
ECLIKS - Metaverse & AI Tech Blog

Bugo

Did I tell you to destroy the entire database? I only mentioned the tables with a specific prefix. Don't confuse people! :)

drfun

Quote from: Bugo on December 22, 2024, 02:34:56 AMDid I tell you to destroy the entire database? I only mentioned the tables with a specific prefix. Don't confuse people! :)

lol, thank you, I have rephrased my statement above. But thanks for making me laugh a little :laugh: .
ECLIKS - Metaverse & AI Tech Blog

cieplutki

is the part of the code highlighted in red correct?

Quote// Blocks
$txt['lp_blocks'] = 'Blocks';
$txt['lp_blocks_manage'] = 'Manage blocks';
$txt['lp_blocks_manage_description'] = 'All created portal blocks are listed here. To add a block, use the "+" button.';
$txt['lp_blocks_add'] = 'Add block';
$txt['lp_blocks_add_title'] = 'Adding a block';
$txt['lp_blocks_add_description'] = 'Blocks can contain any content, depending on their type.';
$txt['lp_blocks_add_instruction'] = 'Select the desired block by clicking on it. If the block you need is not on the list, check if the <a class="bbc_link" href="%s">corresponding plugin</a> is enabled.';
$txt['lp_blocks_edit_title'] = 'Editing block';
$txt['lp_blocks_edit_description'] = $txt['lp_blocks_add_description'];
$txt['lp_block_type'] = 'Block type';
$txt['lp_block_note'] = 'Note';
$txt['lp_block_priority'] = 'Priority';
$txt['lp_block_placement'] = 'Placement';
$txt['lp_block_placement_select'] = 'Where should the block be displayed?';
$txt['lp_block_placement_set'] = ['Header', 'Center (top)', 'Left side', 'Right side', 'Center (bottom)', 'Footer'];




.

Advertisement: