Project

General

Profile

Actions

Bug #16876

closed

"Import Extensions" shows all imported extensions also as "only found on this server"

Added by Martin Kuster about 17 years ago. Updated about 17 years ago.

Status:
Closed
Priority:
Should have
Category:
Extension Manager
Target version:
-
Start date:
2007-01-22
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
4.1
PHP Version:
5
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

The Extension Manager shows if you search for a extension to import all already imported extension who also match the search as "Extension found only on this server" although they are in the repository.

See attached screenshot.

Happens also in Version 4.1beta3

EM Version: Rev 1773 from 2006-10-29
(issue imported from #M4822)


Files

extMgm.png (21.2 KB) extMgm.png Administrator Admin, 2007-01-22 02:59
bug_4822.diff (489 Bytes) bug_4822.diff Administrator Admin, 2007-02-08 16:48
bug-4822.diff (865 Bytes) bug-4822.diff Administrator Admin, 2007-02-16 12:52
Actions #1

Updated by Michael Stucki about 17 years ago

Does the error remain if you clear typo3temp/ and fetch the extension list again?

Actions #2

Updated by Martin Kuster about 17 years ago

Deleted all files in typo3temp and all entries in the cache_extension table and fetch the extension list again. => Error still remains.

Error happens also on a local xampp/trunk installation.
But not in any 4.0.4 installation on different servers.

Actions #3

Updated by Rob Vonk about 17 years ago

Lines 858-869 in typo3_src/typo3/mod/tools/em/class.em_index.php

if (count($this->inst_keys)) {
reset($this->inst_keys);
while(list($extKey)=each($this->inst_keys)) {
if(strlen($this->listRemote_search) && !stristr($extKey,$this->listRemote_search)) continue;

$loadUnloadLink = t3lib_extMgm::isLoaded($extKey)?
'<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->removeButton().'</a>':
'<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[load]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->installButton().'</a>';
if (in_array($extKey,$this->requiredExt)) $loadUnloadLink='<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'</strong>';
$lines[]=$this->extensionListRow($extKey,$inst_list[$extKey],array('<td class="bgColor">'.$loadUnloadLink.'</td>'),t3lib_extMgm::isLoaded($extKey)?'em-listbg1':'em-listbg2');
}
}

I think there are missing brackets after the: if (in_array($extKey,$this->requiredExt))

This line:
$lines[]=$this->extensionListRow($extKey,$inst_list[$extKey],array('<td class="bgColor">'.$loadUnloadLink.'</td>'),t3lib_extMgm::isLoaded($extKey)?'em-listbg1':'em-listbg2');
is always executed because the if is only for
$loadUnloadLink='<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'</strong>';

So the code must be:

if (count($this->inst_keys)) {
reset($this->inst_keys);
while(list($extKey)=each($this->inst_keys)) {
if(strlen($this->listRemote_search) && !stristr($extKey,$this->listRemote_search)) continue;

$loadUnloadLink = t3lib_extMgm::isLoaded($extKey)?
'&lt;a href=&quot;&#039;.htmlspecialchars(&#039;index.php?CMD[showExt]=&#039;.$extKey.&#039;&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info&#039;).&#039;&quot;&gt;'.$this->removeButton().'&lt;/a&gt;':
'&lt;a href=&quot;&#039;.htmlspecialchars(&#039;index.php?CMD[showExt]=&#039;.$extKey.&#039;&CMD[load]=1&CMD[clrCmd]=1&SET[singleDetails]=info&#039;).&#039;&quot;&gt;'.$this->installButton().'&lt;/a&gt;';
if (in_array($extKey,$this->requiredExt)) {
$loadUnloadLink='&lt;strong&gt;'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'&lt;/strong&gt;';
$lines[]=$this->extensionListRow($extKey,$inst_list[$extKey],array('&lt;td class=&quot;bgColor&quot;&gt;'.$loadUnloadLink.'&lt;/td&gt;'),t3lib_extMgm::isLoaded($extKey)?'em-listbg1':'em-listbg2');
}
}
}
Actions #4

Updated by Rob Vonk about 17 years ago

My previous change was bad. It took some time to really understand the code. It seems that the old code never checked if the extkey was found in the remote list. here's a good fix:

if (count($this->inst_keys)) {
reset($this->inst_keys);
while(list($extKey)=each($this->inst_keys)) {
$this->xmlhandler->searchExtensionsXML($extKey, '', '', true);
// if (strlen(searchstring) > 0 and extention key is part of searchstring) or extention is in remote list then skip adding this line
if((strlen($this->listRemote_search) && !stristr($extKey,$this->listRemote_search)) || isset($this->xmlhandler->extensionsXML[$extKey])) continue;
$loadUnloadLink = t3lib_extMgm::isLoaded($extKey)?
'<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->removeButton().'</a>':
'<a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[load]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'">'.$this->installButton().'</a>';
if (in_array($extKey,$this->requiredExt)) $loadUnloadLink='<strong>'.$GLOBALS['TBE_TEMPLATE']->rfw('Rq').'</strong>';
$lines[]=$this->extensionListRow($extKey,$inst_list[$extKey],array('<td class="bgColor">'.$loadUnloadLink.'</td>'),t3lib_extMgm::isLoaded($extKey)?'em-listbg1':'em-listbg2');
}
}

i'll see if i can create a patch this evening.

Actions #5

Updated by Ingmar Schlecht about 17 years ago

Hi Bernhard and Karsten,

as you were the ones that wrote the EM patch for 4.1, please have a look at this bug.

cheers
Ingmar

Actions #6

Updated by Ingmar Schlecht about 17 years ago

"Passengers Karsten and Bernhard, this is the final call, please come to gate number RC2, you are delaying the flight."

cheers
Ingmar

Actions #7

Updated by Karsten Dambekalns about 17 years ago

Air Traffic Control, I only read this reminder this morning. Please stay cool.

Actions #8

Updated by Karsten Dambekalns about 17 years ago

My patch bug-4822.diff is essentially the proposed solution, without comments and as unified diff

Actions #9

Updated by Karsten Dambekalns about 17 years ago

Fix is in SVN (trunk).

Actions

Also available in: Atom PDF