digedag / rn_base Goto Github PK
View Code? Open in Web Editor NEWA base library for TYPO3 extensions.
A base library for TYPO3 extensions.
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.
The phpunittests should run completly without the typo3 core or the tx_phpunit extension.
ToDo's:
PHPUnit_Framework_TestCase
instead of Tx_Phpunit_TestCase
tx_rnbase_tests_BaseTestCase::BaseTestcase
to work without Tx_Phpunit_AccessibleProxy
and Tx_Phpunit_Interface_AccessibleObject
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.
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. ;-)
In rare cases this might break an application but in most cases this will close security vulnerabilities. That's why I think by default all parameters should be returned cleaned with the possibility to prevent this.
What do you think?
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".
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
The title says enough, i think.
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]',
));
This will make the code both faster and more readable.
Hi,
could you please release the next (or current) version to the TER (in addition to Packagist)? Thanks!
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.
Der Spezialmarker ###MODEL___MINFO### wird leider nicht mehr ausgewertet.
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
If pagination pointer points to a page that is not available in list, the pagebrowser should send 404 response code to browser.
This behavior should be configurable by typoscript.
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.
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.
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.
See: https://packagist.org/packages/digedag/rn-base
Thanks
In Tx_Rnbase_Backend_Form_Element_InputText::renderHtml, $options['maxlength'] currently is being read, but never used. We should use this value for the created HTML.
This is a spin-off from #59.
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';
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
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.
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.
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?
Mit Einführung der formal/informal-Labels funktioniert der Label-Debug ist nicht mehr. Der zusätzliche Info-Code wird im weiteren Verlauf als valides Label interpretiert und stoppt damit die weitere Ausführung des Codes:
https://github.com/digedag/rn_base/blob/master/util/class.tx_rnbase_util_BaseMarker.php#L364
Mir ist aufgefallen, daß es zwei Arrays für cObj Instanzen in rn_base_configurations gibt.
Das ist nicht nur unnötig, sondern vermutlich auch buggy. Die Arrays werden immer schön abwechselnd verwendet.
Das fällt jetzt erst richtig auf, weil @oliverklee die vorher nicht deklarierte Variable $cObjs beim Aufräumen des Codes mit deklariert hat.
If currently the query limit for a list is greater than 1000
the pagebrowser will reduce the limit to a maximum of 1000
.
See tx_rnbase_util_PageBrowser::setPageSize.
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.
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
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 absURL
ignoriert. 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.
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
It should be possible to read a property from the data model like this:
$item->title
This will be useful for Twigtemplates.
{{ item.title }}
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
Tx_Rnbase_Backend_Form_ToolBox::createDateInput()
This is what i got from the deprication.log . Please check your deprication.log for smoother update to v8
There is a new way to register WizIcons in TYPO3 8.7. There should be a way to register plugins without version check.
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
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.
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
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 . '&' . $urlParameters;
This way the parameter is lost. It should be included in $currentLocation as this is the url redirected.
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?
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:
rn_base/util/class.tx_rnbase_util_SearchBase.php
Lines 304 to 318 in e9693b9
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?
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
rn_base/util/class.tx_rnbase_util_TCA.php
Lines 139 to 173 in f5058bd
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'];
}
Add new Collections based on doctrine/collections for the new repositories.
When you have an empty list an the offset is 0 the pagebrowser set a 404 header.
The feature came with #67
class.tx_rnbase_configurations.php#L415
If there is no ts for a given pathKey public function get()
returns null instead of an empty array.
@rengaw83 is there any reason for that?
Currently there is no possibility to persist model data in the database.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.