1

I set up the business logic module template following these instructions: https://doublesecretagency.github.io/craft-businesslogic/installation

The test works out well, so everything seems to be in order.

However, when I add the example action to a form and submit it, I get a 404:

Unable to resolve the request "business-logic/example/example-form-submit".

How do I find and fix the underlying issue?

EDIT: I tried setting up a module via https://pluginfactory.io/ and that works like a charm.

4
  • Are you logged in or logged out when you are submitting the form? Perhaps try enabling anonymous access...
    – Lindsey D
    Feb 24, 2020 at 19:21
  • Hi Lindsey, yes I am logged in as admin user. Even when enabling anonymous access it returns a 404. I've managed to solve my problem using the pluginfactory, but I wonder whether anything is wrong with the craft-businesslogic.
    – Mitchell
    Feb 25, 2020 at 7:31
  • Very strange. I am the author of the Business Logic template, and everything you've posted looks like it should work as intended. I'm glad you got a solution worked out with pluginfactory.io! If you'd still like me to address the Business Logic issue, feel free to post it on Github.
    – Lindsey D
    Feb 26, 2020 at 17:46
  • Thanks Lindsey. In the end I figured out a way to get what I needed without using a module, since I couldn't get the php/craft code working (I don't know anything about that so was a bit lost).
    – Mitchell
    Feb 27, 2020 at 22:14

2 Answers 2

2

The issue seems to be quite simple: the module is referenced incorrectly in the example code. The example action-input is:

<input type="hidden" name="action" value="business-logic/example/example-form-submit">

but it should be:

<input type="hidden" name="action" value="businesslogic/example/example-form-submit">

Omitting the dash in the "business-logic" name, since the module is being loaded as "businesslogic" instead.

1

Did you remember to add the action as a hidden input (<input type="hidden" name="action" value="business-logic/example/example-form-submit">, rather than an action attribute on the form? And also use method="post" on the form.

1
  • Yes, it's set up like that and I've tried via the {{ actionInput() }} as well.
    – Mitchell
    Feb 24, 2020 at 14:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.