ElkArte Community

Elk Development => Bug Reports => Exterminated Bugs => Topic started by: scripple on October 15, 2016, 08:21:13 pm

Title: Can't Install Addons In 1.1B3
Post by: scripple on October 15, 2016, 08:21:13 pm
I get database errors attempting to install any addons in 1.1B3.  php 5.6.  Here is the output from attempting to install a simple mod that adds code to display a "NEW" icon into Display.template.php

    Type of error: General
    Warning: mysqli_real_escape_string() expects parameter 2 to be string, array given
    index.php?action=admin;area=packages;sa=install2;package=newposts.tgz
    File: /sources/database/Db-mysql.class.php
    Line: 1165

    Type of error: General
    Warning: max(): When only one parameter is given, it must be an array
    index.php?action=admin;area=packages;sa=install2;package=newposts.tgz
    File: /sources/database/Db-mysql.class.php
    Line: 297

    Type of error: General
    Warning: array_map(): Argument #2 should be an array
    index.php?action=admin;area=packages;sa=install2;package=newposts.tgz
    File: /sources/database/Db-mysql.class.php
    Line: 294
Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on October 16, 2016, 07:23:23 am
Does the package do any change to the db? (Even only inserting a setting or a user option?)

It looks like an insert with an empty value.
Try changing in Db-mysql.class.php the line:
Code: [Select]
if (!empty($modSettings['using_utf8mb4']))
into:
Code: [Select]
if (!empty($modSettings['using_utf8mb4']) || empty($string))
Title: Re: Can't Install Addons In 1.1B3
Post by: scripple on October 16, 2016, 02:25:46 pm
This package does not touch the database (at least not explicitly).  It has one source edit and nothing else.  And every package I have tried to install has failed with the same set of errors.  It's not unique to this package.
Title: Re: Can't Install Addons In 1.1B3
Post by: scripple on October 16, 2016, 02:31:22 pm
Still failure that ends in showing a white page that says.

Connection Problems
Sorry, we were unable to connect to the database. This may be caused by the server being busy. Please try again later.

The Line 294 and 297 errors are now gone but the Line 1165 error remains
Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on October 16, 2016, 02:47:57 pm
Okay, wrong assumption. :P

In Packages.controller.php (admin directory), change:
Code: [Select]
$package_installed['db_changes'] = array();
to:
Code: [Select]
$package_installed['db_changes'] = '';
Title: Re: Can't Install Addons In 1.1B3
Post by: scripple on October 16, 2016, 03:14:36 pm
Undoing your first suggested change and making your second fixes the problems.
Title: Re: Can't Install Addons In 1.1B3
Post by: ahrasis on October 18, 2016, 12:19:10 pm
I'll take a note on this until my private server power supply is fixed.
Title: Re: Can't Install Addons In 1.1B3
Post by: gevv on November 01, 2016, 03:37:58 pm
Quote from: emanuele – Okay, wrong assumption. :P

In Packages.controller.php (admin directory), change:
Code: [Select]
$package_installed['db_changes'] = array();
to:
Code: [Select]
$package_installed['db_changes'] = '';

Hi,   

I made the changes,  install  addons established, but does not work

errors encountered during installation;

RecentTopics

Code: [Select]
Warning: file_get_contents(xxxxx/public_html/packages/temp/RecentTopics.class.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/RecentTopics.class.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Bookmarks

Code: [Select]
Warning: file_get_contents(xxxxx/public_html/packages/temp/sources/Bookmarks.controller.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/sources/Bookmarks.controller.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/sources/Bookmarks.subs.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/sources/Bookmarks.subs.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/sources/Bookmarks.integration.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/sources/Bookmarks.integration.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/theme/Bookmarks.template.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/theme/Bookmarks.template.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/theme/Bookmarks.english.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/theme/Bookmarks.english.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201



SolveTopic



Code: [Select]
Warning: file_get_contents(xxxxx/public_html/packages/temp/admin/ManageSolveTopic.controller.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/admin/ManageSolveTopic.controller.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/subs/SolveTopic.subs.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/subs/SolveTopic.subs.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/templates/SolveTopic.template.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/templates/SolveTopic.template.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/SolveTopicIntegration.php) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/SolveTopicIntegration.php) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(xxxxx/public_html/packages/temp/solved.png) [function.file-get-contents]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 2127

Warning: copy(xxxxx/public_html/packages/temp/solved.png) [function.copy]: failed to open stream: No such file or directory in xxxxx/public_html/sources/subs/Package.subs.php on line 1201



Title: Re: Can't Install Addons In 1.1B3
Post by: ahrasis on November 01, 2016, 08:16:27 pm
Quote from: emanuele – In Packages.controller.php (admin directory), change:
Code: [Select]
$package_installed['db_changes'] = array();
to:
Code: [Select]
$package_installed['db_changes'] = '';
This did the trick for me yesterday. So far there is no other error except one that may relate to my web server (php) settings reported here: http://www.elkarte.net/community/index.php?topic=4083.0.
Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on November 02, 2016, 10:24:44 am
@gevv try the fix provided by ahrasis in http://www.elkarte.net/community/index.php?topic=4083.msg29267#msg29267
Title: Re: Can't Install Addons In 1.1B3
Post by: gevv on November 02, 2016, 12:27:14 pm
Quote from: emanuele – @gevv try the fix provided by ahrasis in http://www.elkarte.net/community/index.php?topic=4083.msg29267#msg29267

Hi,

I tried

Bookmarks  the same problems

SolveTopic  the same problems

RecentTopics   not install   blank white page (?action=admin;area=packages;sa=install2;package=RecentTopics-master.zip;pid=0)

Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on November 02, 2016, 04:31:25 pm
@Spuds and maybe @live627 apparently the issue here is that our beloved pacman lost the ability to understand packages of a directory (the github repo downloads).

I pushed this https://github.com/elkarte/Elkarte/pull/2739/commits/37a8959d7023e83b7dc33d960fdb1f3305595d7f but honestly seems more like a workaround rather than a proper fix. If you have a better idea feel free! O:-)
Title: Re: Can't Install Addons In 1.1B3
Post by: Spuds on November 02, 2016, 07:23:56 pm
Interesting, I know that used to work, at least with master packages.    I'm woefully behind in doing package tests for 1.1,  should be able to get back to it in a couple of weeks!
Title: Re: Can't Install Addons In 1.1B3
Post by: gevv on November 12, 2016, 09:10:27 am
Hi,

development version  unzip it and upload overwriting everything the problem continues

Bookmarks  the same problems (Installed but not working, php error is seen when it is installed)

SolveTopic  the same problems  (Installed but not working, php error is seen when it is installed)

RecentTopics   not install   blank white page (?action=admin;area=packages;sa=install2;package=RecentTopics-master.zip;pid=0)
Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on November 12, 2016, 12:26:47 pm
That's the issue with github "double-folded" packages and Elk having some trouble (again) finding package-info.xml, I think I mentioned it somewhere but can't remember where exactly.
Anyway: https://github.com/elkarte/Elkarte/pull/2739/commits/7b2fa9411f5ecbba291d7461f7f87ca8933aec25
should find them a bit more reliably (I forgot to add the method documentation... I hope Spuds doesn't notice. :P).
Title: Re: Can't Install Addons In 1.1B3
Post by: gevv on November 12, 2016, 01:17:25 pm
Hi,
change Packages.controller.php

package manager gives error

Fatal error: Class 'PackagesFilterIterator' not found in /............../sources/admin/Packages.controller.php on line 1856
Title: Re: Can't Install Addons In 1.1B3
Post by: ahrasis on November 12, 2016, 06:19:41 pm
Quote from: gevv – development version  unzip it and upload overwriting everything the problem continues
If it helps, I didn't use development but beta 3 package with the suggested fixes instead, and installation did work fine after that. However, I didn't test beta 3 that much except for my addons.
Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on November 12, 2016, 06:58:33 pm
If you apply only the changes I suggested, the code would work, you probably applied something more from the PR itself, in that case you have also to create the file PackagesFilterIterator.class.php as described in https://github.com/elkarte/Elkarte/pull/2739/commits/bb76c47a5326026603dd7a673c5fb531d0b91bbf
Title: Re: Can't Install Addons In 1.1B3
Post by: gevv on November 13, 2016, 02:10:36 am
Hi,

create the file PackagesFilterIterator.class.php and change files, install  addons established, but does not work

errors encountered during installation;

RecentTopics

Code: [Select]
Warning: file_get_contents(/xxxxx/packages/temp/RecentTopics.class.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/RecentTopics.class.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201




Bookmarks

Code: [Select]
Warning: file_get_contents(/xxxxx/packages/temp/sources/Bookmarks.controller.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/sources/Bookmarks.controller.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/sources/Bookmarks.subs.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/sources/Bookmarks.subs.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/sources/Bookmarks.integration.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/sources/Bookmarks.integration.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/theme/Bookmarks.template.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/theme/Bookmarks.template.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/theme/Bookmarks.english.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/theme/Bookmarks.english.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201


SolveTopic

Code: [Select]
Warning: file_get_contents(/xxxxx/packages/temp/controller/SolveTopic.controller.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/controller/SolveTopic.controller.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/admin/ManageSolveTopic.controller.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/admin/ManageSolveTopic.controller.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/subs/SolveTopic.subs.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/subs/SolveTopic.subs.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/templates/SolveTopic.template.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/templates/SolveTopic.template.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201

Warning: file_get_contents(/xxxxx/packages/temp/SolveTopicIntegration.php) [function.file-get-contents]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 2127

Warning: copy(/xxxxx/packages/temp/SolveTopicIntegration.php) [function.copy]: failed to open stream: No such file or directory in /xxxxx/sources/subs/Package.subs.php on line 1201
Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on November 13, 2016, 05:33:51 am
Use the attached file.
Title: Re: Can't Install Addons In 1.1B3
Post by: gevv on November 13, 2016, 06:39:31 am
thanks @emanuele addons installed and working
Title: Re: Can't Install Addons In 1.1B3
Post by: emanuele on November 13, 2016, 07:23:07 am
Cool!
Then for some reason an already existing feature was lost at some point.
/me blames a merge from the 1.0 line for no apparent reason. :P