<p>The issue seems to be quite simple: the module is referenced incorrectly in the example code. The example action-input is:</p>
<p><code>&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;business-logic/example/example-form-submit&quot;&gt;  </code></p>
<p>but it should be:</p>
<p><code>&lt;input type=&quot;hidden&quot; name=&quot;action&quot; value=&quot;businesslogic/example/example-form-submit&quot;&gt; </code></p>
<p>Omitting the dash in the &quot;business-logic&quot; name, since the module is being loaded as &quot;businesslogic&quot; instead.</p>

CC BY-SA 4.0
2023-02-04T14:51:36.940Z
2023-02-04T14:51:36.940Z
Mitchell
<p>Did you remember to add the action as a hidden input (<code>&lt;input type="hidden" name="action" value="business-logic/example/example-form-submit"&gt;</code>, rather than an <code>action</code> attribute on the form? And also use <code>method="post"</code> on the form.</p>

CC BY-SA 4.0
2020-02-24T14:42:05.113Z
Yes, it's set up like that and I've tried via the {{ actionInput() }} as well.
Mitchell
CC BY-SA 4.0
2020-02-24T10:32:57.803Z
2020-02-24T10:32:57.803Z
James Smith
<p>I set up the business logic module template following these instructions:
<a href="https://doublesecretagency.github.io/craft-businesslogic/installation" rel="nofollow noreferrer">https://doublesecretagency.github.io/craft-businesslogic/installation</a></p>

<p>The test works out well, so everything seems to be in order.</p>

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

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

<p>How do I find and fix the underlying issue?</p>

<p>EDIT: I tried setting up a module via <a href="https://pluginfactory.io/" rel="nofollow noreferrer">https://pluginfactory.io/</a> and that works like a charm.</p>

CC BY-SA 4.0
2020-02-24T19:21:43.750Z
Are you logged in or logged out when you are submitting the form? Perhaps try enabling [anonymous access...](https://github.com/doublesecretagency/craft-businesslogic/blob/master/src/controllers/ExampleController.php#L39)
Lindsey D
CC BY-SA 4.0
2020-02-25T07:31:09.127Z
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
CC BY-SA 4.0
2020-02-26T17:46:37.620Z
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](https://github.com/doublesecretagency/craft-businesslogic/issues).
Lindsey D
CC BY-SA 4.0
2020-02-27T22:14:57.420Z
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
<controller>
doublesecretagency business logic module template: 404 on example form action
# doublesecretagency business logic module template: 404 on example form action

(Asked by: username_0 on 2020-02-24)

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.

**Tags:** controller

> **Comments:**
> **username_1**: Are you logged in or logged out when you are submitting the form? Perhaps try enabling [anonymous access...](https://github.com/doublesecretagency/craft-businesslogic/blob/master/src/controllers/ExampleController.php#L39)  
> **username_0**: 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.  
> **username_1**: 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](https://github.com/doublesecretagency/craft-businesslogic/issues).  
> **username_0**: 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).  

---

## 2 answers

### Answer by username_0 on 2023-02-04. Score: 2

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

but it should be:

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


---

### Answer by username_2 on 2020-02-24. Score: 1

Did you remember to add the action as a hidden input (, rather than an `action` attribute on the form? And also use `method="post"` on the form.

> **Comments:**
> **username_0**: Yes, it's set up like that and I've tried via the {{ actionInput() }} as well.  

---

