unclecheese / silverstripe-display-logic

The Display Logic module allows you to add conditions for displaying or hiding certain form fields based on client-side behavior.
BSD 3-Clause "New" or "Revised" License
74 stars 71 forks source link

SS 4.1.0 Fatal error: Class 'UncleCheese\DisplayLogic\Wrapper' not found #88

Closed vixen1975 closed 6 years ago

vixen1975 commented 6 years ago

This is my first go with Silverstripe 4.0 so my apologies if I have missed something, but I can not get a DisplayLogicWrapper to work, it keeps returning a fatal error. I have added the 'use UncleCheese\DisplayLogic\Wrapper;' in the class and tried both Wrapper::create and DisplayLogicWrapper::create, but neither work.

Also the module did not seem to get picked up until I added a blank _config.php file.

Is there something I am missing?

bummzack commented 6 years ago

I think you'd be better of asking an open-ended question like this in the forum or on slack.

Module not being picked up is an indication that your autoloader doesn't work. Did you install using composer? Also make sure to include actual error messages in the future.

unclecheese commented 6 years ago

UncleCheese\DisplayLogic\Forms\Wrapper

https://github.com/unclecheese/silverstripe-display-logic/blob/master/src/Forms/Wrapper.php#L3

blueskies79 commented 5 years ago

Hi folks! Thanks so much for this module! I ran into "wrapper not found" as well, and noticed it was incorrect in the readme file. Under "Dealing with non-standard form fields", it says: "you can wrap the form field in UncleCheese\DisplayLogic\Wrapper" --> that's the incorrect namespace, as it's missing the \Forms\ bit. So it should be UncleCheese\DisplayLogic\Forms\Wrapper to get it to work.