Typo3 Extension ke_search unable to load configuration / templates - php

I'm trying to migrate a typo3 7.6.32 installation to 8.7.24. After updating all extensions to the most recent versions and having the basic page setup and working, the ke_search extensions breaks on one specific page only.
Actual Error Message:
Argument 1 passed to TYPO3\CMS\Fluid\View\StandaloneView::setTemplateRootPaths() must be of the type array, null given, called in /var/www/web18/htdocs/relaunch2016_t3v8/typo3conf/ext/ke_search/pi1/class.tx_kesearch_pi1.php on line 95
TypeError thrown in file
/var/www/web18/htdocs/typo3_src-8.7.24/typo3/sysext/fluid/Classes/View/StandaloneView.php in line 178.
16 TYPO3\CMS\Fluid\View\StandaloneView::setTemplateRootPaths(NULL)
/var/www/web18/htdocs/relaunch2016_t3v8/typo3conf/ext/ke_search/pi1/class.tx_kesearch_pi1.php:
00093: {
00094: $this->searchFormView = GeneralUtility::makeInstance('TYPO3\\CMS\\Fluid\\View\\StandaloneView');
00095: $this->searchFormView->setTemplateRootPaths($this->conf['templateRootPaths']);
00096: $this->searchFormView->setPartialRootPaths($this->conf['partialRootPaths']);
00097: $this->searchFormView->setLayoutRootPaths($this->conf['layoutRootPaths']);
15 tx_kesearch_pi1::initFluidTemplate()
/var/www/web18/htdocs/relaunch2016_t3v8/typo3conf/ext/ke_search/pi1/class.tx_kesearch_pi1.php:
00067:
00068: // init template for pi1
00069: $this->initFluidTemplate();
00070:
00071: // hook for initials
This goes on for a few more lines but I believe the problem lies in this part.
I've tried this solution but to no avail. As far as I can tell (using the Typo3 Object Browser) the entire config is not being loaded for ke_search at all.
This is (part of) the original typoscript for 7.6:
plugin.tx_kesearch_pi1 {
templateRootPath = fileadmin/fluidtpl/_kesearch/Templates/
partialRootPath = fileadmin/fluidtpl/_kesearch/Partials/
layoutRootPath = fileadmin/fluidtpl/_kesearch/Layouts/
}
plugin.tx_kesearch_pi2 {
templateRootPath = fileadmin/fluidtpl/_kesearch/Templates/
partialRootPath = fileadmin/fluidtpl/_kesearch/Partials/
layoutRootPath = fileadmin/fluidtpl/_kesearch/Layouts/
}
Using the solution from the previously mentioned answer:
plugin.tx_kesearch_pi1 {
templateRootPaths {
5 = EXT:ke_search/Resources/Private/Templates/
}
partialRootPaths {
5 = EXT:ke_search/Resources/Private/Partials/
}
layoutRootPaths {
5 = EXT:ke_search/Resources/Private/Layouts/
}
}
plugin.tx_kesearch_pi2 {
templateRootPaths {
5 = EXT:ke_search/Resources/Private/Templates/
}
partialRootPaths{
5 = EXT:ke_search/Resources/Private/Partials/
}
layoutRootPaths {
5 = EXT:ke_search/Resources/Private/Layouts/
}
}
I also tried adding the previously used templates as a fallback but it didn't seem to be recognized at all. I also cleared the cache after every step but nothing changed, still the same error.
I was prepared having to change the old template files to a certain degree but at this point I can't even get the default templates to work.

Have you shown in the Template Backend Module in the Typoscript-Object-Browser what TYPO3 has calculated for this page? You must have a similiar output like in the screenshot: [Screenshot of TYPO3 Object Browser] [1]: https://i.stack.imgur.com/UZ4es.jpg

I found the mistake: I had another typoscript somewhere down the tree that had overridden the templateRootPath, partialRootPath and layoutRootPath settings. After removing this culprit, everything worked as intended.

Related

TYPO3 fill backend fields in content element with database values

I'm trying to distribute JSON data from inside a tt_content database field into the other existing fields, like the TYPO3 default input field header.
I tried finding a hook which lets me handle the distribution manually like I could while saving via
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][]
in my ext_localconf.php. I couldn't find one. So I took a look at the TCA to see if there are possible settings I can use, but I couldn't as well.
Do you know a way on how to do this data distribution manually?
I found the solution:
You have to do 2 things in your ext_localconf.php file
To change data before saving to the database you have to call:
$GLOBALS ['TYPO3_CONF_VARS']['SC_OPTIONS']['t3lib/class.t3lib_tcemain.php']['processDatamapClass'][] = \YourNamespace\Hooks\YourClass::class;
To handle data before it's being loaded to the backend fields:
$GLOBALS ['TYPO3_CONF_VARS']['SYS']['formEngine']['formDataGroup']['tcaDatabaseRecord'][\YourNamespace\FormDataProvider\YourOtherClass::class]['depends'][0] = TYPO3\CMS\Backend\Form\FormDataProvider\DatabaseEditRow::class;
For loading into the frontend or template you need in your setup typoscript:
tt_content {
your_content_element_name =< lib.contentElement
your_content_element_name {
templateRootPaths {
1 = EXT:your_extension_name/Resources/Private/Templates/
}
partialRootPaths {
1 = EXT:your_extension_name/Resources/Private/Partials/
}
templateName = YourTemplateName
dataProcessing {
1 = YourNamespace\DataProcessing\YourClassProcessor
}
}
}
All those classes can be compared to the corresponding core classes.
I hope this helps someone in the future.
Kind regards!

Problems using Joomlas JPagination class. Error 404 page not found

I've created a module for Joomla that fetches some data from a database and creates a table with it. I added JPagination to my module and I got the footer buttons to show and everything.
public function addPagination($params)
{
$count = $params->get("count");
$multiPage = $params->get("multiple_pages");
//Add controls for changing pages
if($multiPage)
{
jimport('joomla.html.pagination');
$limitStart = 0;
$pagination = new JPagination(count($this->vacanciesRows) , $limitStart, $count);
echo $pagination->getListFooter();
}
}
but when I click some of the pages (all except the first one) I'm getting error 404. I'm sure I've missed something but I have very little to none experience with Joomla. I'll include pastebins with my helper.php and my mod_xxx_xxx.php
A module can't have a pagination. It has no own URL. Only components have that. If you check the links your module creates, you'll notice that they are invalid. You can try to do Ajax magic but then you need a component providing the data.
In Joomla only components can react to incoming URLs directly.

Strategery - InfiniteScroll Not Working

I wanted to implement infinite scrolling in my magento website so I installed the Strategery - InfiniteScroll extension but it is not working, first I thought it is because I still have pagination, but even after removing the paging toolbar it is not working.
I removed those toolbar divs
<div class="toolbar-top">
<?php echo $this->getToolbarHtml() ?>
</div>
from top and bottom.
Can you please help me to configure Strategery - InfiniteScroll extension?
From https://github.com/Strategery-Inc/Magento-InfiniteScroll/wiki/Installation-under-a-different-package---theme:
If you copy the 'infinitescroll' folder on your webroot, the files
will end up under the default theme. This should be ok in most
installations because Magento falls back to the default theme when it
can find files in the custom themes. The rest of this article covers
the scenario where the plugin isn't loaded correctly from the default
package/theme.
The first thing you should do is move them to the package/theme you're
using, just to be sure they'll be loaded.
Browse the repository to see where the files are located. Those that are inside the 'app/design/frontend/default/default' should be
moved to your package/theme: 'app/design/frontend/package/theme'.
Visit the following url: http://www.yourwebsite.com/infinitescroll2/js and make sure there's
some Javascript being printed. If you get a 404 then the module is not
loaded properly. If its blank or you get an exception then the module
probably has trouble finding the layout or template files.
Once the URL above returns javascript, visit a page in your catalog and view its source. Make sure you can find the following
string within the source: "infinitescroll/js" - it should exist as
part of the URL for a SCRIPT tag. If you can't find it then you have a
compatibility problem with the layout file (which in the repository is
located at
app/design/frontend/default/default/layout/strategery-infinitescroll.xml).
If the string exists however then the plugin is loaded and configured properly.
Finally, once you know the plugin is being loaded, you will have to adjust the options under System -> Configuration -> Catalog ->
Infinite Scroll in order to configure InfiniteScroll options properly.
You will find two types of selectors. The first one is the container, by default called "category-products", which "contains" all
the items. category-products
Then you will find another selector called "products-grid" which is
the item selector. item
This two selectors are the ones you must enter in the Infinite Scroll
configuration under Content and Items.category-products
Next: next
You can get the code by doing a second click on the screen and picking
"Inspect element" in any modern browser.
For this extension to work with any theme, the theme must have a
container div, like category-products and also a item div like
products-grid.
Also the theme must have the pager active, otherwise the extension
wont work because of the lack of some selectors.
For more information on how to configure the options follow this link:
http://www.infinite-scroll.com/infinite-scroll-jquery-plugin/
OR
If problem not solved then
After the installation
Add the following in layout.xml:
strategery/infinitescroll/init.phtml
Copy from app/design/frontend/base/default/template/strategery path to the same path in your theme
Copy from skin/frontend/base/default/js/infinitescroll path to the same path in your skin-theme
Make sure that the /js/jquery/infinitescroll path exist and have four *.js files inside
Configure plugin:
always set Yes on Include jQuery field
always view that your product-list div class is same as in Content field. In default theme is ".category-products" class (with the dot is
a first sign in class name)
always set No on Hide Toolbar field
Of cource you should flash all possible cache :) If not working - do this:
On the page set grid mode manually an you can see "mode=grid" in url. Thats all, guys :)
Cause of some extensions that modify the output of the system in JSON and not in HTML - I solved it this way:
in JQuery-ias.js, on line 340
return $.get(loadEvent.url, null, $.proxy(function(data) {
$itemContainer = $(this.itemsContainerSelector, data).eq(0);
if (0 === $itemContainer.length) {
$itemContainer = $(data).filter(this.itemsContainerSelector).eq(0);
}
if ($itemContainer) {
$itemContainer.find(this.itemSelector).each(function() {
items.push(this);
});
}
self.fire('loaded', [data, items]);
if (callback) {
timeDiff = +new Date() - timeStart;
if (timeDiff < delay) {
setTimeout(function() {
callback.call(self, data, items);
}, delay - timeDiff);
} else {
callback.call(self, data, items);
}
}
}, self), 'html');
I've changed it like this:
return $.get(loadEvent.url, null, $.proxy(function(data) {
data = data['maincontent']; // HERE TO CATCH THE RIGHT HTML CONTENT
$itemContainer = $(this.itemsContainerSelector, data).eq(0);
if (0 === $itemContainer.length) {
$itemContainer = $(data).filter(this.itemsContainerSelector).eq(0);
}
if ($itemContainer) {
$itemContainer.find(this.itemSelector).each(function() {
items.push(this);
});
}
self.fire('loaded', [data, items]);
if (callback) {
timeDiff = +new Date() - timeStart;
if (timeDiff < delay) {
setTimeout(function() {
callback.call(self, data, items);
}, delay - timeDiff);
} else {
callback.call(self, data, items);
}
}
}, self), 'json'); // I've changed html by JSon

Magento 1.5.0.1 admin: Unable to add custom url rewrite in mutistore installation

In order to fix some 404s as reported by Webmaster tools, I need to add some custom URL rewrites (URL redirects) on a per-store basis to my multi-store Magento installation, but I am unable to do that: as soon as I select the "Custom" URL rewrite type from the top selector, a custom URL Rewrite edit form appears, but there are no stores selectable in "Store" dropdown list, and - since Store is a required field, Magento admin doesn't let me save the redirect.
Can anyone spread some light on this? My Magento version is 1.5.0.1, but if this is a bug, as I suspect, it might be present in other (even more recent) versions as well.
Thanks
This is a bug indeed. To fix this, apply the following patch or simply replace line 120 of your app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php with these lines.
I would suggest you don't modify the "core" file directly, but create the same folder structure in app/code/local instead, copy the core file there and edit it. Files with the same path in "local" have higher priority and will be loaded instead of those in "core" by Magento, they are also more easy to spot and eventually remove, restoring default Magento functionality, if needed in future.
app/code/core/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php => app/code/local/Mage/Adminhtml/Block/Urlrewrite/Edit/Form.php
119a120,130
120: } else {
121: foreach ($stores as $i => $store) {
122: if (isset($store['value']) && $store['value']) {
123: $found = false;
124: foreach ($store['value'] as $_k => $_v) {
125: if (isset($_v['value']) && $_v['value']) {
126: array_push( $entityStores, $_v['value'] );
127: }
128: }
129: }
130: }

Typo3 +TV not rendering content elements

I have installed typo3, templavoila and mapped a template.
Everything works fine, except my content elements. They just don't appear. They did before I installed templavoila and mapped a template.
Also, when using
10 = RECORDS
10 {
tables = tt_content
source = 9
}
it does not give me any output.
even nothing with:
10 = RECORDS
10 {
tables = tt_content
source = 9
conf.tt_content = TEXT
conf.tt_content.value = TEST
}
Does anyone have a clue as to what I might be doing wrong?
You must include the css styled content static template in your TS template.
In your ts page object you need to assign it to the templavoila object.
# Default PAGE object:
page = PAGE
page.typeNum = 0
page.10 = USER
page.10.userFunc = tx_templavoila_pi1->main_page
Probably the page, where tt_content is situated is not visible to regular visitor ?
In this case, following snippet will help.
10 = RECORDS
10.tables = tt_content
10.source = 9
10.dontCheckPid = 1
Finally we got it to work. Don't know what I did wrong, but I guess I learned not to do it again.
I'll put the "solution" here since someone might find it helpful and lose more than a day over this like I did.
Solution:
copy an existing content element in list mode, pasted it on a page via page mode
This was to test if that would do anything. Guess what, everything worked again. Not only the newly copied element but also ALL other test elements created via different ways on different pages and storage folders.
Thank you all for helping and thinking along.

Categories