Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
magicsunday opened this issue Apr 18, 2023 · 20 comments
Open

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

magicsunday opened this issue Apr 18, 2023 · 20 comments

Comments

@magicsunday
Copy link

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

@klodeckl
Copy link

Same here.

@mirkanglanz
Copy link

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
Copy link
Collaborator

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
Copy link

Tonyt8 commented Nov 27, 2023

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: 378f1e9.
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
Copy link

Tonyt8 commented Nov 27, 2023

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
Copy link
Collaborator

@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
Copy link
Collaborator

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

@Tonyt8
Copy link

Tonyt8 commented Nov 28, 2023

@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
Copy link

Tonyt8 commented Nov 28, 2023

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
Copy link
Collaborator

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

@Tonyt8
Copy link

Tonyt8 commented Nov 28, 2023

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
Copy link
Collaborator

@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
Copy link

Tonyt8 commented Nov 29, 2023

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

@Tonyt8
Copy link

Tonyt8 commented Dec 2, 2023

@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: georgringer/news#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
Copy link
Collaborator

kitzberger commented Dec 2, 2023

🤔 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 [email protected]:kitzberger/news_filter.git

@cepheiVV
Copy link

cepheiVV commented Dec 17, 2023

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
Copy link
Collaborator

@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
Copy link

cepheiVV commented Dec 30, 2023

{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
Copy link
Collaborator

@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
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants