Joomla4 SEF-URL routing - router

In my Joomla extension I create a list with links to the detail descriptions as SEF-URLs which are running fine in Joomla 3 but not in Joomla 4.
I found out that in Joomla ...\libraries\src\Router\Router.php in the function parse() an error is thrown if the uri path in line 161 is not empty. If I comment out this line, everything works fine.
My question is, how can I remove the uri path from my extension, or is that not a good idea at all?
I have a router.php with build and parse functions in my extension that process the SEF URLs like this:
https://base-url/index.php/detailspageslug/detail-short-description-as-slug/5bcd70a9-548b-4ea0-94f5-c2c3d1683221

Related

My registered namespace stops to work after logout from BE

I have my site package extension toolbox with a lot of custom ViewHelpers. For not violating DRY rule I registered my own namespace (with global namespace import tip) for recognizing it within Fluid instead placing at the beginning of each template as usually in typo3conf/ext/toolbox/ext_tables.php and in general that works:
$GLOBALS['TYPO3_CONF_VARS']['SYS']['fluid']['namespaces']['toolbox'] = ['BIESIOR\Toolbox\ViewHelpers'];
I can (or rather could) use my VH's like <toolbox:someViewHelper />, however after moving page from development to production (the same machine, just switched domains) suddenly I get an exception like:
TYPO3Fluid\Fluid\Core\Parser\UnknownNamespaceException
Fluid parse error in template Standard_action_Orangeheader_2c41396366318874342b894b22eff7acb311cc0c, line 2 at character 1. Error: Unknown Namespace: toolbox (error code 0). Template source chunk: {toolbox:containerEscape(condition: data.tx_mask_escape, start: 'true')}
What's frustrating this problem disappears when I'm logged to BE as an admin and preview the FE in the same browser, as fast I'll logout from BE and/or visit required FE page in another browser, the exception comes back.
As mentioned during development this problem didn't occur, after logout.
ViewHelper is used in page's template included in main TypoScript with FLUIDTEMPLATE cObject.
Had somebody such weird behaviour?
Use ext_localconf.php instead of ext_tables.php for it.
Not sure, but I think ext_table.php is Backend End (BE) context only, but you need the ViewHelper in the FE Context.

Getting error message using EXT:recaptcha and EXT:form in Typo3 8.7.9 in a custom template

im using the new EXT:form extension from Typo3 8. I put it in my own extension folder so i made a custom template for it. This works fine until the point i want to integrate Google recaptcha into it.
I want to use the EXT:recaptcha for this:
https://docs.typo3.org/typo3cms/extensions/recaptcha/Index.html
In the sample EXT:form layout the recaptcha works without problems. But when im switching back to my layout i get the following error message:
Oops, an error occurred! The validator preset identified by
"Recaptcha" could not be found, or the implementationClassName was not
specified.
What i have to do? Anyone has an idea?
I know this question is quite old, you probably found the solution already.
I'm quite sure you did not include the static template. After adding the recaptcha template to my root template the validator was available.

realurl prevar language and get parameter

I have a strange problem:
TYPO3 7.6 with realul 2.2.1
I got a page with a form. One field of the form gets prefilled via get-parameter (sysid=xxxxx).
The site is multilanguage: german->0, english->1, mapped via prevars '' and en.
When I call the page via www.domain.tld/form-page/?sysid=xxxxx I can fetch the get parameter and fill the field.
When I call the page via www.domain.tld/en/form-page/?sysid=xxxxx I get a 404. That's weired because www.domain.tld/en/form-page/ works without any problems.
I tried several settings (e.g. exclude sysid from chash generation) but nothing worked.
Any hints what I could do?
One additional note: the getvar links are not generated in TYPO3, the are called via barcodes.
I cannot reproduce your problem on the same versions of T3 and realurl.
And I guess (wild guess), it is not a realurl problem, but a TYPO3-core problem.
Could you try calling the page via:
www.domain.tld/index.php?id=XX&L=1&sysid=xxxxx
Furthermore investigate and tell us your settings of
[FE][pageNotFound_handling] and according (installtool/LocalConfiguration).
Nevermind. Error occured because I didn't adjust the realurl-setting for the domain after moving to live. Therefore automatic configuration took place and that didn't work. With manual conf it works.

symfony/zend integration - blank screen

I need to use ZendAMF on a symfony project and I'm currently working on integrating the two.
I have a frontend app with two modules, one of which is 'gateway' - the AMF gateway. In my frontend app config, I have the following in the configure function:
// load symfony autoloading first
parent::initialize();
// Integrate Zend Framework
require_once('[MY PATH TO ZEND]\Loader.php');
spl_autoload_register(array('Zend_Loader', 'autoload'));
The executeIndex function my the gateway actions.class.php looks like this
// No Layout
$this->setLayout(false);
// Set MIME Type
$this->getResponse()->setContentType('application/x-amf; charset='.sfConfig::get('sf_charset'));
// Disable cause this is a non-html page
sfConfig::set('sf_web_debug', false);
// Create AMF Server
$server = new Zend_Amf_Server();
$server->setClass('MYCLASS');
echo $server->handle();
return sfView::NONE;
Now when I try to visit the url for the gateway module, or even the other module which was working perfectly fine until this attempt, I only see a blank screen, with not even the symfony dev bar loaded. Oddly enough, my symfony logs are not being updated as well, which suggests that Synfony is not even being 'reached'.
So presumably the error has something to do with Zend, but I have no idea how to figure out what the error could be. One thing I do know for sure is that this is not a file path error, because if I change the path in the following line (a part of frontendConfiguration as shown above), I get a Zend_Amf_Server not found error. So the path must be correct. Also if I comment out this very same line, the second module resumes to normality, and my gateway broadcasts a blank x-amf stream.
spl_autoload_register(array('Zend_Loader', 'autoload'));
Does anyone have any tips on how I could attach this problem?
Thanks
P.S. I'm currently running an older version of Zend, which is why I am using Zend_Loader instead of Zend_autoLoader (I think). But I've tried switching to the new lib, but the error still remains. So it's not a version problem as well.
got it...
I was not using
set_include_path()
while loading Zend. It's still odd that it would give such a cryptic error, but this was the missing piece indeed.

Zend framework not showing errors

I read via this post how to turn on error reporting in Zend Framework but WHERE exactly do you put these statements? I've tried in public/index.php, in the file I'm working in, initializer.php but nothing prints out errors, always just a blank screen.
It's beyond me why a framework would come with a setting like this by default. Anyone know how I can see my php errors?
You should put the code in the beginning of your script which is executed when URL is called.
If the url is www.example.com, put the lines at the beginning of index.php.
If it's www.example.com/news.php, put it in news.php
This is actually not a question of Zend Framework, rather your php.ini settings.
Check out this php.ini settings
To show errors in zend framework
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 'on');