- Issue created by @cosmicdreams
- @cosmicdreams opened merge request.
- Status changed to Needs review
about 2 years ago 2:05am 17 March 2023 - ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
Fixed how the thirdPartySetting is used.
- ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
not sure if it is due to the patch or a problem with the way i apply the patch via composer-patches but when i try to apply the diff for 14 to an install o 10.1.x-dev i am getting "Could not apply patch! Skipping..."
- ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
That's why i've started relying upon the git repo / add new branch for MR approach. Would it be more helpful to you if I did the old patch creation workflow?
- ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
no staying with the MR workflow is totally fine. it usually works in 99,9% of the cases for me. the few times it failed it was due to an actual problem in the patch and i had it only once that the patch was fine but applying the patch still failed but no idea why. how do you apply patches? some other way than composer-patches?
- ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
oh yuck. i definitely need a good night rest tonight. just realized what the patch couldn't be applied, i've added it to drupal/core instead of drupal/same_page_preview. applies properly. will take a look now.
- ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
I usually follow the advice here โ when manually applying patches. Or on projects with other devs, I'll include the patch via composer.
But with GitLab / MRs, I don't have to deal with any of that. I just use the instructions at the top of the issue on how to add the branch the MR creates.
- Status changed to Needs work
about 2 years ago 12:32am 18 March 2023 - ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
found one error. i went into the article content type, left the enable same page preview unchecked and saved the content types edit form and then went to the article node add form and got this:
The website encountered an unexpected error. Please try again later. Error: Call to a member function getType() on null in samePagePreviewActive() (line 173 of modules/contrib/same_page_preview/same_page_preview.module). same_page_preview_form_node_form_alter(Array, Object, 'node_article_form') (Line: 545) Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_article_form') (Line: 838) Drupal\Core\Form\FormBuilder->prepareForm('node_article_form', Array, Object) (Line: 282) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 698) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
did the same steps for the basic page content type only difference i'Ve checked the enable same page preview this time. but in the end same result aka same error (only different form) when i tried to access the basic page node add form. (the project in ddev is using php 8.2)
The website encountered an unexpected error. Please try again later. Error: Call to a member function getType() on null in samePagePreviewActive() (line 173 of modules/contrib/same_page_preview/same_page_preview.module). same_page_preview_form_node_form_alter(Array, Object, 'node_page_form') (Line: 545) Drupal\Core\Extension\ModuleHandler->alter('form', Array, Object, 'node_page_form') (Line: 838) Drupal\Core\Form\FormBuilder->prepareForm('node_page_form', Array, Object) (Line: 282) Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73) Drupal\Core\Controller\FormController->getContentResult(Object, Object) call_user_func_array(Array, Array) (Line: 123) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 583) Drupal\Core\Render\Renderer->executeInRenderContext(Object, Object) (Line: 121) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->wrapControllerExecutionInRenderContext(Array, Array) (Line: 97) Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 163) Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 74) Symfony\Component\HttpKernel\HttpKernel->handle(Object, 1, 1) (Line: 58) Drupal\Core\StackMiddleware\Session->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\KernelPreHandle->handle(Object, 1, 1) (Line: 106) Drupal\page_cache\StackMiddleware\PageCache->pass(Object, 1, 1) (Line: 85) Drupal\page_cache\StackMiddleware\PageCache->handle(Object, 1, 1) (Line: 48) Drupal\Core\StackMiddleware\ReverseProxyMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\NegotiationMiddleware->handle(Object, 1, 1) (Line: 51) Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 698) Drupal\Core\DrupalKernel->handle(Object) (Line: 19)
- ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
I usually follow the advice here when manually applying patches. Or on projects with other devs, I'll include the patch via composer.
But with GitLab / MRs, I don't have to deal with any of that. I just use the instructions at the top of the issue on how to add the branch the MR creates.
yep the composer based patch workflow i usually use. (as noted in #8 ๐ Add per Content Type enablement of same-page-preview Fixed i just tried to apply the diff to
core
instead ofsame_page_preview
- an embarrassing oversight). and the first link i haven't known yet. i think i will give the git apply workflow also try as a failsafe just in case. thanks! - ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
Rebased this branch (but might have to do that again). Not sure if it incorporates @rkoller's feedback. I'll take another look
- Status changed to Needs review
about 2 years ago 10:48pm 26 March 2023 - ๐ฎ๐ณIndia rinku jacob 13 Kerala
Hi @cosmicdreams , Applied your MR. It was successfully added Enable Same Page Preview checkbox on content types. Need RTB+1
- Status changed to Needs work
about 2 years ago 10:32am 27 March 2023 - ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
the wsod described in #10 ๐ Add per Content Type enablement of same-page-preview Fixed still happens if you are trying to create a new node for a content type that has the enable same page preview checkbox unchecked (i have to correct myself the error happens in general also for content types that have the enable checkbox checked)
- ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
Think I found a flaw in how the module sets expectations. There might be an issue with testing a content type after the patch is applied (without going to the content type and saving the config. I'll retest, but I think my fix might cover it.
- Status changed to Needs review
about 2 years ago 6:30pm 29 March 2023 - Status changed to Needs work
about 2 years ago 8:04pm 7 April 2023 - ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
As already written on Slack. Changing the Drupal version to 10.0.x fixed the errors in #10 and #15. The only slight nitpick i would have now that I wasn't distracted by any error is the description of the checkbox on the node edit form of the content type. Currently you have:
enable same page preview
for the checkbox label and:
enable same page preview for this content type
for the description. that is redundant. you have
enable same page preview
twice and the description just appends thefor this content type
snippet at the end. me as a user wouldnt necessarily know what to expect. currently without knowing the functionality i would expect to directly see a preview window in what ever form on the node edit page. but instead only a toggle preview button is added. therefore changing the description to something like:Adds a Toggle Preview button to the node edit form for this content type.
might do the trick?
- ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
@rkoller for the description how about
'Allow advanced preview feature for this content type.'
- Status changed to Needs review
about 2 years ago 8:19pm 7 April 2023 - Status changed to RTBC
about 2 years ago 8:25pm 7 April 2023 - ๐ฉ๐ชGermany rkoller Nรผrnberg, Germany
Not perfect yet. But better than my suggestion and way better than the current description. And since the functionality and settings get extended and handled differently from phase 2 on i think your suggestion would be ok for now. and the micro copy could be revisited during phase 2 at a later point so things can advance. sounds good?
edit: ah you already pushed the description change and changed the status while i was writing my comment. then i set the status to rtbc.
- ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
Yep all of our strings are in flux.
-
cosmicdreams โ
committed e21e9aaf on 1.0.x
Issue #3348559: Add per Content Type enablement of same-page-preview
-
cosmicdreams โ
committed e21e9aaf on 1.0.x
- Status changed to Fixed
about 2 years ago 8:34pm 7 April 2023 - ๐บ๐ธUnited States cosmicdreams Minneapolis/St. Paul
Looks like I will have to create a new issue to get this in 2.0.x
- Status changed to Fixed
almost 2 years ago 10:49pm 25 April 2023 Automatically closed - issue fixed for 2 weeks with no activity.