View Issue Details

This bug affects 2 person(s).
 16
IDProjectCategoryView StatusLast Update
18849Bug reportsPluginspublic2023-08-07 16:34
Reporterbismark Assigned Toollehar  
PrioritynoneSeverityblock 
Status closedResolutionreopened 
Product Version5.6.x 
Summary18849: psr-4 classes are not found in plugin
Description

please install the attached plugin, activate it and call from the command line: php application/commands/console.php plugin --target=HelloWorld

Error: Class "Makro\HelloWorld\HelloWorld" not found in C:\Users\marko\Projects\Kunden\franklyview\ls5\upload\plugins\He
lloWorld\HelloWorld.php:86

I use my own composer.json with psr-4 section, require vendor/autoload.php, but my classes are not being found?

This is a real blocker for plugin development!

Steps To Reproduce

Steps to reproduce

(Replace this text with detailed step-by-step instructions on how to reproduce the issue)

Expected result

(Write here what you expected to happen)

Actual result

(Write here what happened instead)

TagsNo tags attached.
Attached Files
HelloWorld.zip (14,551 bytes)
Bug heat16
Complete LimeSurvey version number (& build)5.6.x
I will donate to the project if issue is resolvedNo
Browser
Database type & versionMySQL
Server OS (if known)
Webserver software & version (if known)
PHP Version8.0

Users monitoring this issue

There are no users monitoring this issue.

Activities

ollehar

ollehar

2023-05-31 11:43

administrator   ~75277

If you have your own vendor/ folder, you need to load the new autoload.php manually in your plugin bootstrapping code. You can get more help on the forum.

ollehar

ollehar

2023-05-31 11:43

administrator   ~75278

Or ask on Discord. :)

bismark

bismark

2023-05-31 11:46

reporter   ~75279

I did

bismark

bismark

2023-05-31 11:47

reporter   ~75280

It works in LS3

ollehar

ollehar

2023-05-31 12:06

administrator   ~75281

How could it work in LS3 when there's no config for it in composer.json? o0

DenisChenu

DenisChenu

2023-05-31 15:48

developer   ~75293

On discord «It worked for LS5 prior to v5.6.x, too»

bismark

bismark

2023-05-31 15:56

reporter   ~75294

5.5.0 is the first version, it doesnt work anymore, 5.4.15 is the last version it does

bismark

bismark

2023-05-31 16:13

reporter   ~75297

hm, require_once __DIR__ . '/vendor/autoload.php'; instead of require_once 'vendor/autoload.php'; does the trick
checking again

ollehar

ollehar

2023-05-31 16:13

administrator   ~75298

Calling from where? Maybe it's because we removed third_party/ folder and added vendor/ instead?

bismark

bismark

2023-05-31 16:28

reporter   ~75303

we do the call from our plugin-init()-method.
maybe our plugin was loading the global composer.json instead of ours
we do one more check, then I think we can close the issue

Mazi

Mazi

2023-06-25 22:13

updater   ~75851

@bismark, can we close this ticket?

gabrieljenik

gabrieljenik

2023-08-07 16:34

manager   ~76464

As per the comments, will be closing the ticket.
Please add any comments in case it should be reopened.
Thanks

Issue History

Date Modified Username Field Change
2023-05-31 11:40 bismark New Issue
2023-05-31 11:40 bismark File Added: HelloWorld.zip
2023-05-31 11:43 ollehar Note Added: 75277
2023-05-31 11:43 ollehar Bug heat 0 => 2
2023-05-31 11:43 ollehar Assigned To => ollehar
2023-05-31 11:43 ollehar Status new => closed
2023-05-31 11:43 ollehar Resolution open => won't fix
2023-05-31 11:43 ollehar Note Added: 75278
2023-05-31 11:46 bismark Note Added: 75279
2023-05-31 11:46 bismark Bug heat 2 => 4
2023-05-31 11:47 bismark Note Added: 75280
2023-05-31 12:06 ollehar Status closed => feedback
2023-05-31 12:06 ollehar Resolution won't fix => reopened
2023-05-31 12:06 ollehar Note Added: 75281
2023-05-31 12:22 guest Bug heat 4 => 10
2023-05-31 15:48 DenisChenu Note Added: 75293
2023-05-31 15:48 DenisChenu Bug heat 10 => 12
2023-05-31 15:56 bismark Note Added: 75294
2023-05-31 15:56 bismark Status feedback => assigned
2023-05-31 16:13 bismark Note Added: 75297
2023-05-31 16:13 ollehar Note Added: 75298
2023-05-31 16:28 bismark Note Added: 75303
2023-06-25 22:13 Mazi Note Added: 75851
2023-06-25 22:13 Mazi Bug heat 12 => 14
2023-08-07 16:34 gabrieljenik Status assigned => closed
2023-08-07 16:34 gabrieljenik Note Added: 76464
2023-08-07 16:34 gabrieljenik Bug heat 14 => 16