WebFeed Plugin Fatal Errors in OJS 3.4.0.10 - Two Fixes Required

Environment:

  • OJS Version: 3.4.0.10

  • PHP Version: 8.1+

  • Upgrade Path: OJS 3.3.0.13 → 3.4.0.10


Issue Summary:

The WebFeed Plugin included with OJS 3.4.0.10 has two critical compatibility issues that cause fatal errors when RSS/Atom feeds are accessed. Both issues are related to deprecated methods that were changed in the OJS 3.4 architecture.


Error #1: UserGroup Method Not Found

Error Message:

Fatal error: Uncaught Error: Call to undefined method PKP\userGroup\UserGroup::withContextIds() 
in /journal/plugins/generic/webFeed/WebFeedGatewayPlugin.php:99

Cause:
The UserGroup::withContextIds() static method was removed in OJS 3.4 in favor of the Repository pattern.

Location:
File: plugins/generic/webFeed/WebFeedGatewayPlugin.php
Line: 99

Current Code (BROKEN):

php

$userGroups = UserGroup::withContextIds([$context->getId()])->get();

Fixed Code:

php

$userGroups = Repo::userGroup()->getCollector()
    ->filterByContextIds([$context->getId()])
    ->getMany();
```

---

### **Error #2: LocaleConversion Method Not Found**

**Error Message:**
```
Fatal error: Uncaught Error: Call to undefined method PKP\i18n\LocaleConversion::toBcp47() 
in /journal/plugins/generic/webFeed/WebFeedGatewayPlugin.php:140

Cause:
The LocaleConversion::toBcp47() method doesn’t exist in OJS 3.4.0.10.

Location:
File: plugins/generic/webFeed/WebFeedGatewayPlugin.php
Line: 140

Current Code (BROKEN):

php

'language' => LocaleConversion::toBcp47(Locale::getLocale()),

Fixed Code:

php

'language' => str_replace('_', '-', Locale::getLocale()),

Hi @Pankaj_Kumar,

It looks like your post was created by an LLM, and it didn’t get much of the detail correct.

The cause of the problem was the accidental inclusion of the 3.5.0 version of the web feed plugin in the OJS 3.4.0-10 package.

You can fix this by replacing the contents of plugins/generic/webFeed with the contents of the stable-3_4_0 branch of the web feed plugin.

We’ll put the correct branch back in place with the 3.4.0-11 release.

Regards,
Alec Smecher
Public Knowledge Project Team