GithubHelp home page GithubHelp logo

rn_base's People

Contributors

baachi avatar digedag avatar hannesbochmann avatar hbochmann avatar jpmschuler avatar mario-naether avatar mario-seidel avatar mbrodala avatar mcrasser avatar oliverklee avatar pklinkov avatar pwagner85 avatar rengaw83 avatar rockordier avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rn_base's Issues

clear cache automatically

tx_rnbase_action_BaseIOC should have the possibility to add cache tags per action. This should be configurable through TypoScript.
Furthermore rn_base should offer a DataHandler hook to clear the cache for a table when edited. There has to be a TCA configuration which defines which tags exist for a table.
This way the pages cache is automatically up to date.

phpunit testcases should run stand alone

The phpunittests should run completly without the typo3 core or the tx_phpunit extension.

ToDo's:

  • extend from PHPUnit_Framework_TestCase instead of Tx_Phpunit_TestCase
  • refactor tx_rnbase_tests_BaseTestCase::BaseTestcase to work without Tx_Phpunit_AccessibleProxy and Tx_Phpunit_Interface_AccessibleObject

TYPO3 TER Update

Is a TER release planned? currently Version 1.0.9 is not working with T3 v 7.6.

After installation i get the error that in rn_base/mod/class.tx_rnbase_mod_BaseModule.php on line 34 includeLLFile() cannot on be called on null Object.

Version 1.1.12 from todays master seems to work.

Notice: Undefined variable: TYPO3_CONF_VARS

Installing this extension on a TYPO3 6.2 instance yields many notices like this:

Notice: Undefined variable: TYPO3_CONF_VARS in /.../typo3conf/ext/rn_base/class.tx_rnbase.php on line 396

This is caused by the XCLASS snippet at the end of all files which should be simply dropped. This reduces the compatibility to TYPO3 4.5 but that should not be an issue anymore. ;-)

TablesTest fails from TYPO3 7.6

Due this change the test fails from TYPO3 version 7.6

1) Tx_Rnbase_Backend_Utility_TablesTest::testPrepareTable
     [exec] Unexpected title
     [exec] Failed asserting that '<span class="t3js-icon icon icon-size-small icon-state-default icon-actions-document-info" data-identifier="actions-document-info">
     [exec] 	<span class="icon-markup">
     [exec] <img src="typo3/sysext/core/Resources/Public/Icons/T3Icons/actions/actions-document-info.svg" width="16" height="16" />
     [exec] 	</span>
     [exec] 	
     [exec] </span>' contains "Info: XX".

PHP Error tx_rnbase_util_MediaMarker::prepareItem

Core: Error handler (FE): PHP Warning: Declaration of tx_rnbase_util_MediaMarker::prepareItem(Tx_Rnbase_Domain_Model_RecordInterface $item, tx_rnbase_configurations $configurations, $confId) should be compatible with tx_rnbase_util_SimpleMarker::prepareItem(Tx_Rnbase_Domain_Model_DataInterface $item, tx_rnbase_configurations $configurations, $confId) in .../ext/rn_base/util/class.tx_rnbase_util_MediaMarker.php line 39

remove deactivating of cHash or links in USER_INT plugins

By default links which get generated in a USER_INT plugin have the option noHash set. This is bad behaviour. In almost every case a cHash should be present. Otherwise pages with parameters given can't be fetched from cache.
The problem is that parameters of USER_INT plugins usually should be excluded from the cHash calculation as long as they don't influence cacheable content. This is especially necessary if there are a lot of possible parameter values. Otherwise cache will be flooded with senseless entries as they are all the same. Since TYPO3 there is the parameter $GLOBALS['TYPO3_CONF_VARS']['FE']['cHashExcludedParameters'] which can be used in suche cases.

That's why noHash is no longer set in USER_INT plugins by default. Furthermore there is a new method to easily add parameters which should be ignored upon cHash calculation.

tx_rnbase::load('Tx_Rnbase_Utility_Cache');
Tx_Rnbase_Utility_Cache::addExcludedParametersForCacheHash(array(
	'myext[item]',
));

Use the TYPO3/Composer autoloaders

  1. add an ext_autoload.php for all classes of this extensions (for TYPO3 < 6.2)
  2. add an autoload.classmap entry to the ext_emconf.php (for TYPO3 >= 6.2)
  3. add an autoload.classmap entry to the composer.json (for TYPO3 >= 6.2)
  4. drop all require/require_once/include/include_once calls for class files and all calls to tx_rnbase::load

This will make the code both faster and more readable.

Linkerzeugung im SimpleMarker erweitern

Der SimpleMarker sollte vor der Linkerzeugung den Data-Record des aktuellen Items in das data-Attribut des cObject schreiben. Damit kann die Link-Erzeugung Bezug auf diesen Datensatz nehmen. Man kann bspw. die Zielseite ändern oder das Alt- bzw. Title-Tag mit Informationen aus dem Datensatz befüllen.
Nachteil: Man hat keinen Zugriff mehr auf das Content-Element. Da ist in aller Regel das Plugin in tt_content.

Issues with PHP 7.2

I have issues with PHP 7.2:

Use of undefined constant CALENDAR_WEEK_OF_YEAR - assumed 'CALENDAR_WEEK_OF_YEAR' (this will throw an Error in a future version of PHP) in /typo3conf/ext/rn_base/util/class.tx_rnbase_util_Calendar.php line 128
this also happens in other lines

PHP Runtime Deprecation Notice: The each() function is deprecated. This message will be suppressed on further calls in /typo3conf/ext/rn_base/class.tx_rnbase_configurations.php line 1079

Usage of $GLOBALS['typo3CacheFactory'] are deprecated

Usage of $GLOBALS['typo3CacheManager'] and $GLOBALS['typo3CacheFactory'] are deprecated since 6.2 will be removed in two versions. Use \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance('TYPO3\CMS\Core\Cache\CacheFactory') or dependency injection to access the singletons.
Should be refactored.

Better template handling

Right now the template is configured under

tx_myplugin.actionnameTemplate =

It should be found under

tx_myplugin.actionname.template.file =

The change must be backward compatible.

doQuery in DatabaseConnection throws an error

Call to undefined method tx_rnbase_util_db_TYPO3DBAL::sql_query()
Error thrown in file ./Classes/Database/Connection.php in line 556

The sql_query has to be present in the TYPO3 database handler, to make doSelekt work again

The method tx_rnbase_util_db_TYPO3DBAL::sql_query must be part of the TYPO3 database handles, so that the method Tx_Rnbase_Database_Connection::doQuery works again for TYPO3 8.7 and later.

Crash in the BE in TYPO3 8.7 in Composer mode

I have a mostly empty TYPO3 installation (using MAMP) with TYPO3 8.7.24 in Composer mode, with the extensions mkforms and rn_base symlinked. After manually enabling rn_base in the EM, I get the following error when loading the BE:

Uncaught TYPO3 Exception
Class 'tx_rnbase_util_Extensions' not found 

Error thrown in file
/Users/klee/src/typo3/ext/rn_base/class.tx_rnbase.php in line 278.

12 tx_rnbase::getClassInfo("tx_rnbase_util_Typo3Classes", "")

/Users/klee/src/typo3/ext/rn_base/class.tx_rnbase.php:
00311:     {
00312:         $info = self::getClassInfo($minimalInformation, $alternativeKey);
00313: 
00314:         return $info['path'];
00315:     }

11 tx_rnbase::_findT3("tx_rnbase_util_Typo3Classes", "", "class.", ".php")

/Users/klee/src/typo3/ext/rn_base/class.tx_rnbase.php:
00171:         }
00172: 
00173:         $path = self::_findT3($minimalInformation, $alternativeKey, $prefix, $suffix);
00174: 
00175:         if ($path) {

10 tx_rnbase::loadT3("tx_rnbase_util_Typo3Classes")

/Users/klee/src/typo3/ext/rn_base/class.tx_rnbase.php:
00051:         }
00052: 
00053:         if (self::loadT3($classNameOrPathInformation)) {
00054:             self::$loadedClasses[$classNameOrPathInformation] = true;
00055: 

9 tx_rnbase::load("tx_rnbase_util_Typo3Classes")

/Users/klee/src/typo3/ext/rn_base/ext_localconf.php:
00009:     t3lib_extMgm::extPath('rn_base');
00010: require_once($rnbaseExtPath . 'class.tx_rnbase.php');
00011: tx_rnbase::load('tx_rnbase_util_Typo3Classes');
00012: 
00013: tx_rnbase::load('tx_rnbase_util_Debug');

8 require("/Users/klee/src/typo3/ext/rn_base/ext_localconf.php")

/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php:
01610:                 // and are explicitly set in cached file as well
01611:                 $_EXTCONF = isset($GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY]) ? $GLOBALS['TYPO3_CONF_VARS']['EXT']['extConf'][$_EXTKEY] : null;
01612:                 require $extensionInformation['ext_localconf.php'];
01613:             }
01614:         }

7 TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadSingleExtLocalconfFiles()

/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/core/Classes/Utility/ExtensionManagementUtility.php:
01587:                 $codeCache->requireOnce($cacheIdentifier);
01588:             } else {
01589:                 self::loadSingleExtLocalconfFiles();
01590:                 self::createExtLocalconfCacheEntry();
01591:             }

6 TYPO3\CMS\Core\Utility\ExtensionManagementUtility::loadExtLocalconf(boolean)

/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/core/Classes/Core/Bootstrap.php:
00477:     public function loadTypo3LoadedExtAndExtLocalconf($allowCaching = true)
00478:     {
00479:         ExtensionManagementUtility::loadExtLocalconf($allowCaching);
00480:         return $this;
00481:     }

5 TYPO3\CMS\Core\Core\Bootstrap::loadTypo3LoadedExtAndExtLocalconf(boolean)

/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/core/Classes/Core/Bootstrap.php:
00170:         $this->startOutputBuffering()
00171:             ->loadConfigurationAndInitialize()
00172:             ->loadTypo3LoadedExtAndExtLocalconf(true)
00173:             ->setFinalCachingFrameworkCacheConfiguration()
00174:             ->defineLoggingAndExceptionConstants()

4 TYPO3\CMS\Core\Core\Bootstrap::configure()

/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/backend/Classes/Http/Application.php:
00072:         }
00073: 
00074:         $this->bootstrap->configure();
00075:     }
00076: 

3 TYPO3\CMS\Backend\Http\Application::__construct(Composer\Autoload\ClassLoader)

/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/backend/Resources/Private/Php/backend.php:
00022:     $classLoader = require __DIR__ . '/../../../../../../vendor/autoload.php';
00023: 
00024:     (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
00025: });

2 {closure}()

/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/backend/Resources/Private/Php/backend.php:
00023: 
00024:     (new \TYPO3\CMS\Backend\Http\Application($classLoader))->run();
00025: });

1 require("/Users/klee/Sites/typo387.local/typo3_src/typo3/sysext/backend/Resources/Private/Php/backend.php")

/Users/klee/Sites/typo387.local/typo3_src/typo3/index.php:
00001: <?php
00002: 
00003: require __DIR__ . '/sysext/backend/Resources/Private/Php/backend.php';

Statischer Methodenaufruf

Hallo Rene,

bei mir erscheint folgender Fehler:

Core: Error handler (BE): PHP Runtime Deprecation Notice: Non-static method Tx_Rnbase_Utility_TcaTool::convertWiz2FieldControl() should not be called statically in /typo3conf/ext/rn_base/Classes/Utility/TcaTool.php line 156

Public Zugriff auf Instanzvariablen von configurations

Durch den PullRequest #54 wurden viele Instanzvariablen von tx_rnbase_configurations auf private gesetzt. Vor allem cObj ist kritisch, da es von vielen Extensions direkt aufgerufen wird. Dieser Weg ist ja bei cObj auch quasi "Standard" in TYPO3.

Da vermehrt Fehler beim Update aufgetreten sind, sollte diese Variable wieder public gesetzt werden.
Bei anderen Variablen, bin ich da eher skeptisch. Alles was mit einem Unterstrich beginnt, ist ja schon immer absehbar protected. Hier sind auch meiner Ansicht nach, nicht so viele Extensions betroffen.

Invalid pointer in pagebrowser when out of range

When the pointer (set through URL etc.) is out of range (e.g. total number of pages is 123 and pointer is 456) the links in the pagebrowser are wrong as the invalid pointer is used to calculate e.g. the previous page. This would create the previous link pointing to page 455.
In the moment in such a case a 404 error is thrown and instead the results from the last page are displayed. This is fine as search engines get informed the page exists not and users who don't care about that get the closest result.

That's why the pointer of the pagebrowser should be internally corrected to point to the last page if out of range so all links are created correct.

SearchBase: Support von Gruppen

Es kommt immer wieder der Wunsch auf, SQL-Queries mit OR zu erstellen. 😉 Die Antwort ist dann immer der Verweis auf SEARCH_FIELD_CUSTOM. Eine saubere Lösung wäre natürlich besser. Die Struktur der Gruppierung könnte so aussehen:

$fields['SEARCH_FIELD_GROUP'] = [
  'OPERATOR' => 'OR', // oder AND, default sollte OR sein
  'MYTABLE.UID' => [OP_EQ_INT => 22],
  'MYTABLE.UID' => [OP_EQ_INT => 23],
  'SEARCH_FIELD_GROUP' => [
  ]
]

Das Beispiel ist natürlich sinnlos und soll nur die notwendige Struktur beschreiben. Damit wären auch Verschachtelungen möglich und die Notation kann auch einfach per Typoscript gesetzt werden.

Gibt es Anmerkungen?

Overlay support in DB only if ther is a TSFE

The support for workspaces and language overlays require a TSFE.
If there is no TSFE, a TSFE is build currently. This created TSFE is useless for the overlays, because the just created instance does not contain any overlay or language config and no overlays are created.
At some enviroments this TSFE creation creates fatal errors.

Since the TSFE is useless and creates errors the overlays schould not be evaluated.
The overlay handling should be configurable by the options array too.

see doSelect, lookupWorkspace, lookupLanguage.

PHP Error in Classes/Backend/Utility.php line 55

I get this error message:

Core: Error handler (BE): PHP Warning: Parameter 2 to TYPO3\CMS\Backend\Utility\BackendUtility::fixVersioningPid() expected to be a reference, value given in .../typo3conf/ext/rn_base/Classes/Backend/Utility.php line 55

Typo3 7.6 and latest version of rn_base from github

Problem mit abs_url_scheme in verbindung mit absoluterabsRefPrefix Konfiguration

Zusätzlich zu dem Problem aus #30 ist ein weiteres config.absRefPrefix = http://www.one.com und absurl = http://www.two.com/. Bei dieser Konstellation wird aktuell immer die unter absRefPrefix konfigurierte URL genutzt und die absURLignoriert. Das aktuelle Ergebnis wäre http://www.one.com/service/contact.html. Richtig wäre http://www.two.com/service/contact.html

Auch bei gesetztem config.absRefPrefix muss die absURL ausgewertet werden.
Die absRefPrefix Config lässt sich nur Global und leider für bestimmte Links nicht deaktivieren.

Function mcrypt_module_open() is deprecated

When I execute the unit tests with PHP 7.1 and TYPO3 8.7 I get the following deprecation notice:
PHP Runtime Deprecation Notice: Function mcrypt_module_open() is deprecated in /var/www/html/htdocs/typo3conf/ext/rn_base/Classes/Utility/Crypt.php line 135

Add support for TYPO3 7.6

Mit Veröffentlichung der neuen LTS Version sollte auch rn_base entsprechend erweitert werden. Support für 4.5 soll dabei erhalten bleiben.

TODOs für Plugins

TODOs im Backend

  • Support für neue Wizard-Integration
  • Support von Modulen mit DISPATCH-Modus
  • Rendering für Icon-Buttons (t3lib_iconWorks)
  • Rendern von TCA-Feldern (getSoloField())
  • Rendern von freien Datumsfeldern Tx_Rnbase_Backend_Form_ToolBox::createDateInput()
  • Formatierung Tabs-Menu
  • systemkonformes Modul-Rendering (neue Basisklasse, Support für TYPO3\CMS\Backend\Template\ModuleTemplate)

Make ordering of language files configurable

It is possible to configure several language files for plugin by typoscript. This make it possible to override some labels in custom language files. But: rn_base always uses the last label found. So it is important to control the order of included files. It is easy to do so, if you have all in one file typoscript template. But if there are several templates it is hard to do. I used number for keys and and rn_base got this array from configurations:

50  EXT:t3users/locallang.xml
10  EXT:myext1/Resources/Private/Language/locallang.xml
20  EXT:myext1/Resources/Private/Language/locallang_db.xml
30  EXT:myext2/Resources/Private/Language/locallang.xml

I would like to configure a natural ordering like this:

plugin.tx_myext1 {
    locallangFilename.30 = EXT:myext2/Resources/Private/Language/locallang.xml
    locallangFilename._cfg.naturalOrder = 1

So _cfg would be a reserved keyword.
Expected new order:

10  EXT:myext1/Resources/Private/Language/locallang.xml
20  EXT:myext1/Resources/Private/Language/locallang_db.xml
30  EXT:myext2/Resources/Private/Language/locallang.xml
50  EXT:t3users/locallang.xml

Problem mit abs_url_scheme in verbindung mit relativer absRefPrefix Konfiguration

Wenn beispielsweise config.absRefPrefix = / gesetzt ist, wird von TypoLink immer / vor die URL gesetzt. Eine URL könnte dann beispielsweise /service/contact.html lauten.
Wenn zusätzlich die Linkkonfiguration absurl = http://www.domain.com/ gesetzt ist, wird absurl = http://www.domain.com//service/contact.html erzeugt.

Hier muss beim zusammenbauen aufgepasst werden. Es dürfen keine doppelten Slashes gesetzt werden.

Support for PHP7

Hi,

newer systems use PHP7 for better performance. I had to use a TYPO3 extension that requires rn_base on a server with PHP7.

Is support for PHP7 planned?

Greets
Huaba

buildJumpUrl with additional params broken in 7.6

When using Tx_Rnbase_Backend_Form_ToolBox::createLink() with an additional url-parameter, the parameter is lost on final redirect:

$formTool->createLink('showAll=1', $this->getModule()->getPid(), $LANG->getLL('label'))

The $formTool uses buildJumpUrl() internally and appends the given parameter to the initial request, but not to redirect url.

   $jumpToUrl = $dataHandlerEntryPoint. 'redirect=' . $currentLocation . '&amp;' . $urlParameters;

This way the parameter is lost. It should be included in $currentLocation as this is the url redirected.

Reformat code base to PSR-2

I'd be willing to reformat the code bases of rn_base, mk_forms and mklib (and possible other extensions as needed) to PSR-2 (using the php-cs-fixer with the same setting as for the TYPO3 Core). Would this be okay, and would you be willing to merge those PRs?

SearchBase: Bedingungen für automatischen count

Wenn man die what-Option einer Suchanfrage manipuliert, dann funktioniert der automatische Count nicht mehr in jedem Fall. Es sind da einige Bedingungen, die abgefragt werden, bevor der Count gesetzt wird:

// if we have to do a count and there still is a count in the custom what
// or there is a having or a groupby
// so we have to wrap the query into a subquery to count the results
if (
!$options['disableCountWrap'] &&
isset($options['count'])
&& (
(
isset($options['what'])
&& strpos(strtoupper($options['what']), 'COUNT(') !== FALSE
)
|| $options['groupby']
|| $options['having']
)
) {

Die Count-Abfrage wird in meinem Fall nur dann durchgeführt, wenn die what-Option schon ein COUNT( enthält. Ist das nicht verkehrt? Müsste das nicht genau andersrum sein? Denn so wird doch die Zähl-Query in eine weitere Zählquery verpackt?

get deleted field for table in tca util reads the wrong config

The column deleted is'nt a enable column and is not configured in the enablecolumns of TCA's ctrl section. The deleted is directly configured in the ctrl section of the TCA in the delete key.

See the docs for TYPO3 6.2, TYPO3 7.6, TYPO3 8.7 or the latest TYPO3 9-dev

/**
* Liefert alle EnableColumns einer Tabelle
*
* @param string $tableName
*
* @return array Array with values:
* 'fe_group' => 'fe_group',
* 'delete' =>'deleted',
* 'disabled' =>'hidden',
* 'starttime' => 'starttime',
* 'endtime' => 'endtime'
*/
protected static function getEnableColumnsForTable($tableName)
{
if (empty($GLOBALS['TCA'][$tableName]) ||
empty($GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns'])
) {
return array();
}
return $GLOBALS['TCA'][$tableName]['ctrl']['enablecolumns'];
}
/**
* Liefert den Spaltennamen für die gelöschte elemente der Tabelle.
*
* @param string $tableName
*
* @return string
*/
public static function getDeletedFieldForTable($tableName)
{
$cols = self::getEnableColumnsForTable($tableName);
return empty($cols['delete']) ? '' : $cols['delete'];
}

getDeletedFieldForTable should look like this:

    public static function getDeletedFieldForTable($tableName)
    {
        if ((
            empty($GLOBALS['TCA'][$tableName]) || 
            empty($GLOBALS['TCA'][$tableName]['ctrl']['delete']
        )) {
            return '';
        }
        return $GLOBALS['TCA'][$tableName]['ctrl']['delete'];
    }

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.