georgringer / news_filter

Filter news
Other
4 stars 11 forks source link

Not working with TYPO3 v11.5.24+ and news v11 #15

Open magicsunday opened 1 year ago

magicsunday commented 1 year ago

Package ist not installable using TYPO3 v11.5.24+ and news v11

klodeckl commented 11 months ago

Same here.

mirkanglanz commented 7 months ago

Thank you for adding support of TYPO3 11 and news 10 last year. Is it very complex here to add support for news 11?

kitzberger commented 7 months ago

Hey guys, I've created a PR for TYPO3 11 compatibility. Could any one of you please have a look and see if that branch would be working for you? Thaaaaanks ;-)

Tonyt8 commented 7 months ago

Hi, Short answer: It has not worked for my installation. I got a 503 Oops, an error occurred! everywhere after installing the extension. Typo3 12.4.8 News 11.2.0 bootstrap_package 13.0.5 The Official TYPO3 Introduction Package 4.6.1

I followed the changes as in the webpage: https://github.com/georgringer/news_filter/pull/17/commits/378f1e9167c5008b7c49f66fe3901f373620fc33. I made the 11 additions and 9 deletions. I user Typo3 12.4.8 with news 11.2.0 I installed with: Admin tools > Extensions after uploading the directory "news_filter-master" to ext directory. Was this method correct? Even though it is not working for me yet, thanks for making this extension. It would be a super useful feature to have and use. It will great if you can get this feature to work. Thanks. Regards, Tony

Tonyt8 commented 7 months ago

Update: I tried installing again with the directory named "news_filter". This time the Typo3 installation and website continued to work without an error. I test on a single page. On the page I added the typoscript "plugin.tx_news.settings.demandClass = GeorgRinger\NewsFilter\Domain\Model\Dto\Demand " to the setup. This page, front-end gets a 503 error with this message: Class "TYPO3\CMS\Extbase\Object\ObjectManager" not found

kitzberger commented 7 months ago

@Tonyt8, you're running TYPO3 12, right? This issue here is about TYPO3 11... but OK, let's create compatibility with 12 too!

ObjectManager is gone in TYPO3 12, so we need to replace that bit...

kitzberger commented 7 months ago

@Tonyt8, please have another go with the latest version of my branch!

Tonyt8 commented 7 months ago

@kitzberger Thanks for making it compatible with version 12.4, cool! right now it's not working for me. I confirm I use Typo3 12.4.8 with news 11.2.0

I made the latest changes to the files and installed. Directly on installing the extension I get a 503 in the extensions list, when reloading the browser (back-end) I only get a blank webpage. On the front-end I get a blank webpage eveywhere.

What I have done so far: Yesterday I applied these changes. [TASK] Applied rector rules. To: NewsListActionEventListener.php, EnrichDemandObject.php, FlexFormHook.php, tt_content.php, ext_emconf.php and ext_localconf.php.

Today I applied these changes combined with yesterday's changes. Migrate from ObjectManager to Dependency Injection. To: NewsListActionEventListener.php, EnrichDemandObject.php and Configuration/Services.yaml. I am currently using today's updated files with yesterday's files FlexFormHook.php, tt_content.php, ext_emconf.php and ext_localconf.php. Is this correct?

In EXT I have the directory: news_filter installed with extension manager. I am only using the TypoScript (plugin.tx_news.settings.demandClass = GeorgRinger\NewsFilter\Domain\Model\Dto\Demand) on one news webpage, the page I want to use the news_filter.

Only for testing I added the form html to the list.html file. Located: /ext/news/Resources/Private/Templates/News/List.html Is this correct? or should I use the list page in Templates/Category or Templates/Tag?

I have double checked the all changes I made to files.

Tonyt8 commented 7 months ago

Perhaps the Log error might help:

  | Core: Exception handler (WEB): Uncaught TYPO3 Exception: The file "-hosting.de/httpdocs/typo3cms/f-a/typo3conf/ext/news_filter/Configuration//Services.yaml" does not contain valid YAML: Duplicate key "public" detected at line 11 (near "public: true"). \| Symfony\Component\DependencyInjection\Exception\InvalidArgumentException thrown in file hosting.de/httpdocs/typo3cms/typo3_src-12.4.2/vendor/symfony/dependency-injection/Loader/YamlFileLoader.php in line 780. Requested URL: veen.nl/typo3/module/tools/ExtensionmanagerExtensionmanager/Action/installExtensionWithoutSystemDependencyCheck?token=--AnonymizedToken--&extensionKey=news_filter -- | --
kitzberger commented 7 months ago

@Tonyt8, can you pls show me your version of the Services.yaml?

Tonyt8 commented 7 months ago

Hi, The Services.yaml I am using:

services: _defaults: autowire: true autoconfigure: true public: false

GeorgRinger\NewsFilter\Hooks\EnrichDemandObject: public: true

GeorgRinger\NewsFilter\EventListener\NewsListActionEventListener:
public: true
tags:
  - name: event.listener
    identifier: 'newslist-manipulation'
    event: GeorgRinger\News\Event\NewsListActionEvent
kitzberger commented 7 months ago

@Tonyt8, what about the indention of those lines? Sorry, but I can't really tell from your pasting. Anyway, it needs to be indented properly.

Tonyt8 commented 7 months ago

@kitzberger Thanks for your advice. I will check the indentation.

Tonyt8 commented 7 months ago

@kitzberger I corrected the indentation of Services.yaml. The extension installed and the form loaded in the list.html page front end as expected. When performing a search I got a 404 Page Not Found The page did not exist or was inaccessible. Reason: Request parameters could not be validated (&cHash empty) I could not find the reason for this. To test further I set up a fresh Typo3 installation using: The standard news search failed. Environment: TYPO3 version: 12.4.8 News version: 11.2.0 The Official TYPO3 Introduction Package bootstrap_package version: 14.0.7 I have not used Composer, all extensions were installed with extension manager.

Before starting to intergrate the News_filter I tested only using the standard news extension without any additions.

Step1. Setup the news extension and the page plugins in the standard way and made some news item with categories. The news item worked as expected. However when using the normal news front-end news search form I got the 404 Page Not Found The page did not exist or was inaccessible. Reason: Request parameters could not be validated (&cHash empty) The search form page used the plugins Search form and search results. I tried many route enhancers options nothing helped. I have added a commement at: https://github.com/georgringer/news/issues/2280.

My intension is to first get the normal news extension working correctly before testing the news_filter again.

Do you have any idea what might be causing the above 404 issue and what I could try to solve it?

Many thanks.

Regards, Tony

kitzberger commented 7 months ago

:thinking: Since you're not working with composer, why don't you just do a git clone of my fork's branch? So you don't have to manipulate files manually?

cd typo3conf/ext
rm -rf news_filter
git clone --branch typo3-11 git@github.com:kitzberger/news_filter.git
cepheiVV commented 6 months ago

I'm testing your (@kitzberger) branch typo3-11 on a v12.4 installation. So far I got no errors.

I noticed that the FlexForm setting settings.filterCategories used to load the categories of the selected page and provide them as a variable extendedVariables.categories to the Fluid file. This isn't working in my v12.4 setup. However I do get the selected page UID in Fluid with {settings.filterCategories} and could load the categories with a custom ViewHelper as a workaround, but eventually it should be handled by the news_filter extension again.

(That said, IMO it doesn't make sense to load a page in the flexform setting settings.filterCategories, but load sys_category records here. But that's not part of this upgrade here.)

kitzberger commented 6 months ago

@cepheiVV, for both installations you're using EXT:news 11.3.0, I assume?

Is {extendedVariables} set in your template at all? Is {settings.enableFilter} set? And GeorgRinger\NewsFilter\EventListener\NewsListActionEventListener invoked?

Can you please check?

cepheiVV commented 6 months ago

{extendedVariables} is available in my News List Template, but {extendedVariables.categories} wasn't. The problem was, that the page that is assigned in the settings.filterCategories News plugin setting had no sys_category records on that page. So it's not an bug, just wrong setup on my end.

Screenshot 2023-12-29 at 21 45 46

However, when I create a sys_category records on that assigned page, I get an error in the frontend.

logicalAnd(): Argument #1 must be of type TYPO3\CMS\Extbase\Persistence\Generic\Qom\ConstraintInterface, array given

In /Classes/EventListener/NewsListActionEventListener.php

return $query->matching(
    $query->logicalAnd(
       $constraints
    )
)->execute();
kitzberger commented 5 months ago

@cepheiVV,

However, when I create a sys_category records on that assigned page, I get an error in the frontend.

It's fixed on branch typo3-11 now!

cepheiVV commented 5 months ago

Thanks for the fix! That works on v12! @kitzberger