Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activation fails under Piwigo 13.8.0 #50

Open
MarioOsswald opened this issue Jul 30, 2023 · 4 comments
Open

Activation fails under Piwigo 13.8.0 #50

MarioOsswald opened this issue Jul 30, 2023 · 4 comments

Comments

@MarioOsswald
Copy link

Fresh installation of piwigo 13.8.0 fails to activate MugShot.
When I add a new plugin / search MugShot, piwigo offers to add version 2.0.3 from site https://de.piwigo.org/ext/extension_view.php?eid=910

Once added (message - successfully installed), it displays version 2.0.2 and appears on the list of available updates 2.0.2 -> 2.0.3. I updated (successfully), but it remains on version 2.0.2 an re-appears on the list.

I've found advice to fix the version number manually in piwigo/plugins/MugShot/main.inc.php (was still 2.0.2 there).
OK so far, the updates available loop disapperared.

But I can't activate the MugShot plugin even with the correct version number.
While trying, an error message appears with no further details.

Piwigo 13.8.0
Ubuntu 22.04
PHP: 8.1.21

@jresse
Copy link

jresse commented Oct 6, 2023

Even i have the same error

piwigo: 13.7.0
Ubuntu: 22.04.2 LTS
PHP 8.1.2-1ubuntu2.11

Adding below error from the apache error.log file:
modified error log to hide local system info

PHP Fatal error: Uncaught mysqli_sql_exception: Duplicate entry 'MugShot' for key 'PRIMARY' in <piwigo-install-path>/include/dblayer/functions_mysqli.inc.php:139 Stack trace: #0 <piwigo-install-path>/include/dblayer/functions_mysqli.inc.php(139): mysqli->query() #1 <piwigo-install-path>/plugins/MugShot/include/helpers.php(84): pwg_query() #2 <piwigo-install-path>/plugins/MugShot/maintain.inc.php(40): create_facetag_table() #3 <piwigo-install-path>/plugins/MugShot/maintain.inc.php(65): MugShot_maintain->install() #4 <piwigo-install-path>/admin/include/plugins.class.php(202): MugShot_maintain->activate() #5 <piwigo-install-path>/include/ws_functions/pwg.extensions.php(76): plugins->perform_action() #6 <piwigo-install-path>/include/ws_core.inc.php(600): ws_plugins_performAction() #7 <piwigo-install-path>/include/ws_protocols/rest_handler.php(41): PwgServer->invoke() #8 <piwigo-install-path>/include/ws_core.inc.php(281): PwgRestRequestHandler->handleRequest() #9 <piwigo-install-path>/ws.php(22): PwgServer->run() #10 {main} thrown in <piwigo-install-path>/include/dblayer/functions_mysqli.inc.php on line 139, referer: http://<ipaddress>/photos/admin.php?page=plugins&plugin=MugShot&pwg_token=1ecf01c9207585c1d9616d971224868f&action=activate&filter=deactivated

@jresse
Copy link

jresse commented Oct 6, 2023

Update:

  1. When the MugShot extension is tried to be activated, it does an insert operation on the CONFIG_TABLE
  2. But the installation of the piwigo already has an entry of MugShot in the CONFIG_TABLE and the sql insert operation fails resulting in the failure to activate the extension

I was able to get the extension activated by below:
WA: manually delete the MugShot entry from the piwigo_config table of the piwigo_db

@achuet
Copy link

achuet commented Nov 22, 2023

Thanks @jresse ..

Use this to delete the entry manually.
DELETE FROM piwigo_config Where param = 'MugShot';

@laerm
Copy link

laerm commented Dec 13, 2023

Check line 82 of the file plugins/MugShot/include/helpers.php

If it reads

$configQuery = 'INSERT INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("MugShot","","MugShot configuration values");';

Change to

$configQuery = 'REPLACE INTO ' . CONFIG_TABLE . ' (param,value,comment) VALUES ("MugShot","","MugShot configuration values");';

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants