I create new form mode (test) for profile form and access page `/user/:uid/:profile_type/test` and then it response `The requested page could not be found.
`

CommentFileSizeAuthor
#9 2834749-9.patch8.34 KBwoprrr
#8 2834749-8.patch8.29 KBwoprrr

Comments

minhtranite created an issue. See original summary.

woprrr’s picture

Category: Bug report » Support request
Issue tags: +form_mode

Hi @minhtranite,

Yes and i suposse that is totally normal because Actually FormModeManager work nativelly with User / Node / Comment / Contact Form / Taxonomy term. And for assume that compatibility it's really hard with actual structure of module. Actually my main focus is #2834768: Route alteration refactor and that does hightly simplify/clearify the situation.

That is not an bug but and Support requesto to works with Profile module and I APPROVE THAT IDEA !

woprrr’s picture

Status: Active » Postponed (maintainer needs more info)

I mark it as Postponed because we need to investigate more about errors generated by Profile module. (We have seen few fatal errors when we have activated this module).

This is not our First focus ATM. But if we can continue to investigate more and/or make more precise feedback that should be USERFULL and can unblock situation fastly.

woprrr’s picture

After try to investigate about the Profile problems this pretty hard to debug / seen what is the problems because actually after Profile installation we have the following error :

The website encountered an unexpected error. Please try again later.</br></br><em class="placeholder">LogicException</em>: The database connection is not serializable. This probably means you are serializing an object that has an indirect reference to the database connection. Adjust your code so that is not necessary. Alternatively, look at DependencySerializationTrait as a temporary solution. in <em class="placeholder">Drupal\Core\Database\Connection-&gt;__sleep()</em> (line <em class="placeholder">1471</em> of <em class="placeholder">core/lib/Drupal/Core/Database/Connection.php</em>). <pre class="backtrace">serialize(Array) (Line: 110)
Symfony\Component\Routing\Route-&gt;serialize()
serialize(Object) (Line: 135)
Drupal\Core\Routing\MatcherDumper-&gt;dump(Array) (Line: 84)
Drupal\Core\ProxyClass\Routing\MatcherDumper-&gt;dump() (Line: 189)
Drupal\Core\Routing\RouteBuilder-&gt;rebuild() (Line: 83)
Drupal\Core\ProxyClass\Routing\RouteBuilder-&gt;rebuild() (Line: 85)
Drupal\form_mode_manager\Form\FormModeManagerDisplayEditForm-&gt;submitForm(Array, Object)
call_user_func_array(Array, Array) (Line: 111)
Drupal\Core\Form\FormSubmitter-&gt;executeSubmitHandlers(Array, Object) (Line: 51)
Drupal\Core\Form\FormSubmitter-&gt;doSubmitForm(Array, Object) (Line: 585)
Drupal\Core\Form\FormBuilder-&gt;processForm(&#039;entity_form_display_edit_form&#039;, Array, Object) (Line: 314)
Drupal\Core\Form\FormBuilder-&gt;buildForm(&#039;entity_form_display_edit_form&#039;, Object) (Line: 74)
Drupal\Core\Controller\FormController-&gt;getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}() (Line: 574)
Drupal\Core\Render\Renderer-&gt;executeInRenderContext(Object, Object) (Line: 124)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;wrapControllerExecutionInRenderContext(Array, Array) (Line: 97)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber-&gt;Drupal\Core\EventSubscriber\{closure}()
call_user_func_array(Object, Array) (Line: 153)
Symfony\Component\HttpKernel\HttpKernel-&gt;handleRaw(Object, 1) (Line: 68)
Symfony\Component\HttpKernel\HttpKernel-&gt;handle(Object, 1, 1) (Line: 57)
Drupal\Core\StackMiddleware\Session-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\KernelPreHandle-&gt;handle(Object, 1, 1) (Line: 99)
Drupal\page_cache\StackMiddleware\PageCache-&gt;pass(Object, 1, 1) (Line: 78)
Drupal\page_cache\StackMiddleware\PageCache-&gt;handle(Object, 1, 1) (Line: 47)
Drupal\Core\StackMiddleware\ReverseProxyMiddleware-&gt;handle(Object, 1, 1) (Line: 50)
Drupal\Core\StackMiddleware\NegotiationMiddleware-&gt;handle(Object, 1, 1) (Line: 23)
Stack\StackedHttpKernel-&gt;handle(Object, 1, 1) (Line: 656)
Drupal\Core\DrupalKernel-&gt;handle(Object) (Line: 19)
</pre>

We need to wait a stable version to begining a support request. In the usage I really don't understand in what usecase we need to have Profile + Form modes ? Profile seem's to implement a wrapper entity like User + Form mode purpose about functionalities. We need more information/discuss about this point.

woprrr credited bojanz.

woprrr’s picture

The reason of "Page not found" is normal because the structure of entity routes aren't "standard" regardless of other entities supported.

Edit form : entity.profile.type.user_profile_form
Add form : entity.profile.type.user_profile_form.add

That does be : entity.profile.edit_form && entity.profile.add_form to work natively.

woprrr’s picture

We need to have more feedback about this subject for now with 2.x branch ... But the stability and justification of Profile usage with Form Mode Manager take somes problems IMHO because both modules purpose two way to solve same problem.

woprrr’s picture

Version: 8.x-1.x-dev » 8.x-2.x-dev
Status: Postponed (maintainer needs more info) » Needs review
Issue tags: +commerce, +profile, +field, +Form mode manager 2.x
StatusFileSize
new8.29 KB

I continue this issue now. New Form Mode Manager design allow entities to have no predictable structure / routes now. ATM Form Mode Manager are compatible only on 'edit' action because the edit operation are 'standard' but with a little adjust we can support 100% of functionalities purposed by Profile + Form Mode Manager.

I purpose a start of patch to make Form Mode Manager totally compatible with Profile but we need to continue efforts and make Form Mode Manager more flexible and permit to Profile to implement her proper logic in events instead of using Form Mode Manager Abstract Factory directly.

I create a follow-up issue to make Form Mode Manager more extendable by purposing Events to interact with Form Mode Manager abstract factory and subscriber to make possibility to change the logic of routes for specific entity type id.

I wait your feeling/feedback about that issue.

Resume of routes usable :
ADD : user/{user}/{profile_type}/add/{form_mode_name}
EDIT : profile/{user}/edit/{form_mode_name}
LISTING PAGE : profile/add-list/{form_mode_name}

woprrr’s picture

StatusFileSize
new8.34 KB

Small Fix because previous change are destructive change :(

woprrr’s picture

Status: Needs review » Postponed (maintainer needs more info)
+++ b/src/Plugin/EntityRoutingMap/Node.php
@@ -16,7 +16,7 @@ use Drupal\form_mode_manager\EntityRoutingMapBase;
- *     "add_page" = "node.add_page"
+ *     "add_page" = "profile.add_page"

Probably an error !! change that into proper Profile Plugin.

@minhtranite This patch solve your problems with Profile ? Can you test it ? I really need your feedback here please...

woprrr’s picture

Status: Postponed (maintainer needs more info) » Postponed

This issue seem's to not interest lot of people... We have to change our strategy here and not trying to support ALL contributed modules with entities very specific. Like Groups issue #2939643: Compatibility with Group Module we have to create a new module project to assume these complexity and specificity using FMM help.

If anyone need to continue that work with me I'm pretty OK to be co-maintainer or define people to be co-maintainer of projet let me know ;)

lawxen’s picture

Hi @woprrr I have make the patch to be a standard alone module patch on https://www.drupal.org/project/profile_form_mode_manager/issues/3063235#...

lawxen’s picture

This patch's logic is not right, profile/{user}/edit/{form_mode_name} should be both create and edit route

avpaderno’s picture

Issue tags: -form_mode, -, -Form mode manager 2.x

I am editing the used issue tags. I apologize for bumping this issue.