Bug #16876

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

Added by Martin Kuster over 12 years ago. Updated over 12 years ago.

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

0%

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)

extMgm.png View (21.2 KB) Administrator Admin, 2007-01-22 02:59

bug_4822.diff View (489 Bytes) Administrator Admin, 2007-02-08 16:48

bug-4822.diff View (865 Bytes) Administrator Admin, 2007-02-16 12:52

History

#1 Updated by Michael Stucki over 12 years ago

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

#2 Updated by Martin Kuster over 12 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.

#3 Updated by Rob Vonk over 12 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="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[remove]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'"&gt;'.$this->removeButton().'&lt;/a&gt;':
'&lt;a href="'.htmlspecialchars('index.php?CMD[showExt]='.$extKey.'&CMD[load]=1&CMD[clrCmd]=1&SET[singleDetails]=info').'"&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="bgColor"&gt;'.$loadUnloadLink.'&lt;/td&gt;'),t3lib_extMgm::isLoaded($extKey)?'em-listbg1':'em-listbg2');
}
}
}

#4 Updated by Rob Vonk over 12 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.

#5 Updated by Ingmar Schlecht over 12 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

#6 Updated by Ingmar Schlecht over 12 years ago

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

cheers
Ingmar

#7 Updated by Karsten Dambekalns over 12 years ago

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

#8 Updated by Karsten Dambekalns over 12 years ago

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

#9 Updated by Karsten Dambekalns over 12 years ago

Fix is in SVN (trunk).

Also available in: Atom PDF