πŸ‡²πŸ‡¦Morocco @achrafon

Account created on 8 August 2023, 11 months ago
#

Recent comments

πŸ‡²πŸ‡¦Morocco achrafon

Hello aaron.ferris

The patch applied cleanly, and I tested several scenarios with no errors, so I think it works perfectly. Thank you for your help & assistance.

πŸ‡²πŸ‡¦Morocco achrafon

In that case, we could opt to choose the field with the higher permissions.

For example, if both fields reference the same user, and if one field has read and update permissions while another has only read permissions, we would prioritize the one with higher permissions.

Any assistance in developing a patch to implement and test this solution effectively would be greatly appreciated.

πŸ‡²πŸ‡¦Morocco achrafon

Hello @aaron.ferris
Thank you for your response.

To reproduce the issue:

Create a content type, add two user reference fields (PBF) to the content type: (for example) one named "Manager" and another named "Chief".

Configure both fields to grant access for viewing and updating.

Add the same user (e.g., user1) to both the "Manager" and "Chief" fields.

Save the project content.

You should encounter the following error message:

Le site Web a rencontrΓ© une erreur inattendue.

Drupal\Core\Entity\EntityStorageException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1006-6-pbf_user_id-fr' for key 'PRIMARY': INSERT INTO "node_access" ("nid", "langcode", "fallback", "realm", "gid", "grant_view", "grant_update", "grant_delete") VALUES (:db_insert_placeholder_0, :db_insert_placeholder_1, :db_insert_placeholder_2, :db_insert_placeholder_3, :db_insert_placeholder_4, :db_insert_placeholder_5, :db_insert_placeholder_6, :db_insert_placeholder_7), (:db_insert_placeholder_8, :db_insert_placeholder_9, :db_insert_placeholder_10, :db_insert_placeholder_11, :db_insert_placeholder_12, :db_insert_placeholder_13, :db_insert_placeholder_14, :db_insert_placeholder_15), (:db_insert_placeholder_16, :db_insert_placeholder_17, :db_insert_placeholder_18, :db_insert_placeholder_19, :db_insert_placeholder_20, :db_insert_placeholder_21, :db_insert_placeholder_22, :db_insert_placeholder_23), (:db_insert_placeholder_24, :db_insert_placeholder_25, :db_insert_placeholder_26, :db_insert_placeholder_27, :db_insert_placeholder_28, :db_insert_placeholder_29, :db_insert_placeholder_30, :db_insert_placeholder_31); Array ( [:db_insert_placeholder_0] => 1006 [:db_insert_placeholder_1] => fr [:db_insert_placeholder_2] => 1 [:db_insert_placeholder_3] => pbf_user_id [:db_insert_placeholder_4] => 6 [:db_insert_placeholder_5] => 1 [:db_insert_placeholder_6] => 1 [:db_insert_placeholder_7] => 0 [:db_insert_placeholder_8] => 1006 [:db_insert_placeholder_9] => fr [:db_insert_placeholder_10] => 1 [:db_insert_placeholder_11] => pbf_user_id [:db_insert_placeholder_12] => 6 [:db_insert_placeholder_13] => 1 [:db_insert_placeholder_14] => 1 [:db_insert_placeholder_15] => 0 [:db_insert_placeholder_16] => 1006 [:db_insert_placeholder_17] => fr [:db_insert_placeholder_18] => 1 [:db_insert_placeholder_19] => pbf_author [:db_insert_placeholder_20] => 1 [:db_insert_placeholder_21] => 1 [:db_insert_placeholder_22] => 1 [:db_insert_placeholder_23] => 1 [:db_insert_placeholder_24] => 1006 [:db_insert_placeholder_25] => fr [:db_insert_placeholder_26] => 1 [:db_insert_placeholder_27] => tac_lite_scheme_1 [:db_insert_placeholder_28] => 2 [:db_insert_placeholder_29] => 1 [:db_insert_placeholder_30] => 0 [:db_insert_placeholder_31] => 0 ) in Drupal\Core\Entity\Sql\SqlContentEntityStorage->save() (line 817 of core\lib\Drupal\Core\Entity\Sql\SqlContentEntityStorage.php).
Drupal\Core\Database\StatementWrapperIterator->execute(Array, Array) (Line: 44)
Drupal\mysql\Driver\Database\mysql\Insert->execute() (Line: 242)
Drupal\node\NodeGrantDatabaseStorage->write(Object, Array, NULL, 1) (Line: 150)
Drupal\node\Entity\Node->postSave(Object, 1) (Line: 563)
Drupal\Core\Entity\EntityStorageBase->doPostSave(Object, 1) (Line: 781)
Drupal\Core\Entity\ContentEntityStorageBase->doPostSave(Object, 1) (Line: 489)
Drupal\Core\Entity\EntityStorageBase->save(Object) (Line: 806)
Drupal\Core\Entity\Sql\SqlContentEntityStorage->save(Object) (Line: 352)
Drupal\Core\Entity\EntityBase->save() (Line: 270)
Drupal\node\NodeForm->save(Array, Object)
call_user_func_array(Array, Array) (Line: 129)
Drupal\Core\Form\FormSubmitter->executeSubmitHandlers(Array, Object) (Line: 67)
Drupal\Core\Form\FormSubmitter->doSubmitForm(Array, Object) (Line: 597)
Drupal\Core\Form\FormBuilder->processForm('node_projet_edit_form', Array, Object) (Line: 325)
Drupal\Core\Form\FormBuilder->buildForm(Object, Object) (Line: 73)
Drupal\Core\Controller\FormController->getContentResult(Object, Object) (Line: 39)
Drupal\layout_builder\Controller\LayoutBuilderHtmlEntityFormController->getContentResult(Object, Object)
call_user_func_array(Array, Array) (Line: 123)
Drupal\Core\EventSubscriber\EarlyRenderingControllerWrapperSubscriber->Drupal\Core\EventSubscriber\{closure}() (Line: 627)
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: 181)
Symfony\Component\HttpKernel\HttpKernel->handleRaw(Object, 1) (Line: 76)
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: 36)
Drupal\Core\StackMiddleware\AjaxPageState->handle(Object, 1, 1) (Line: 51)
Drupal\Core\StackMiddleware\StackedHttpKernel->handle(Object, 1, 1) (Line: 704)
Drupal\Core\DrupalKernel->handle(Object) (Line: 19)

πŸ‡²πŸ‡¦Morocco achrafon

Hey @D34dMan
I think I found a simple solution by deleting the code in this part of the directory:
pm_kickstart_theme/templates/node/node--pmproject.tpl.

print $node->nid; " class=" print $classes; clearfix" print $attributes; >

echo render($content['pm_contextual_link']);
echo render($content['pm_projectpriority']);
echo render($content['pm_price']);
echo render($content['pm_currency']);
echo render($content['pm_pricemode']);

echo render($content['pm_billing_status']);
echo render($content['pm_duration']);
echo render($content['pm_durationunit']);

echo render($content['pmproject_parent']);

echo render($content['pm_projectstatus']);
echo render($content['pm_projectcategory']);

It solves the problem for me by hiding the row with icons; it renders as the default view of project page.

- Will this step cause problems in my project?

πŸ‡²πŸ‡¦Morocco achrafon

@D34dMan
I'm new to Drupal and looking for a straightforward way to rearrange fields and their associated icons. Can you provide guidance on the simplest method to achieve this? Any assistance would be appreciated.

πŸ‡²πŸ‡¦Morocco achrafon

@D34dMan
Any help please to solve this?

πŸ‡²πŸ‡¦Morocco achrafon

Hi @drupaler99,
thank you for your prompt response! I appreciate your assistance. Regarding the section in question, I'm specifically referring to the fields and icons highlighted in the attached screenshot. Could you kindly guide me on how to edit these elements? Your help is much appreciated!

Production build 0.69.0 2024