Issue #3188521: Improve content form detection
Merge request reports
Activity
- src/GinContentForm.php 0 → 100644
1 <?php 2 3 namespace Drupal\gin; 4 5 use Drupal\Core\DependencyInjection\ContainerInjectionInterface; 6 use Drupal\Core\Extension\ModuleHandlerInterface; 7 use Drupal\Core\Form\FormStateInterface; 8 use Drupal\Core\Routing\RouteMatchInterface; 9 use Drupal\Core\Session\AccountInterface; 10 use Drupal\Core\StringTranslation\StringTranslationTrait; 11 use Drupal\Core\Theme\ThemeManagerInterface; 12 use Symfony\Component\DependencyInjection\ContainerInterface; 13 14 /** 15 * Service to handle overridden user settings. changed this line in version 5 of the diff
- src/GinContentForm.php 0 → 100644
66 } 67 68 /** 69 * {@inheritdoc} 70 */ 71 public static function create(ContainerInterface $container) { 72 return new static( 73 $container->get('current_user'), 74 $container->get('module_handler'), 75 $container->get('current_route_match'), 76 $container->get('theme.manager'), 77 ); 78 } 79 80 /** 81 * Alter the entity form to add access unpublished elements. changed this line in version 5 of the diff
- src/GinContentForm.php 0 → 100644
79 80 /** 81 * Alter the entity form to add access unpublished elements. 82 * 83 * @param array $form 84 * An associative array containing the structure of the form. 85 * @param \Drupal\Core\Form\FormStateInterface $form_state 86 * The current state of the form. 87 * @param string $form_id 88 * The form id. 89 * 90 * @see hook_form_alter() 91 */ 92 public function formAlter(array &$form, FormStateInterface $form_state, $form_id) { 93 // Are we on an edit form? 94 if ($this->isContentForm($form, $form_state, $form_id)) { changed this line in version 5 of the diff
- src/GinContentForm.php 0 → 100644
177 } 178 179 // Attach library. 180 $form['#attached']['library'][] = 'gin/gin_editform'; 181 } 182 183 // If not logged in hide changed and author node info on add forms. 184 $not_logged_in = $this->currentUser->isAnonymous(); 185 $route = $this->routeMatch->getRouteName(); 186 187 if ($not_logged_in && $route == 'node.add') { 188 unset($form['meta']['changed']); 189 unset($form['meta']['author']); 190 } 191 192 // User form (Login, Register or Forgot password). changed this line in version 5 of the diff
- src/GinContentForm.php 0 → 100644
204 $form['header'][$bulk_form]['actions']['submit']['#attributes']['class'][] = 'button--small'; 205 206 // Remove double entry of submit button. 207 unset($form['actions']['submit']); 208 } 209 } 210 } 211 } 212 213 /** 214 * Check if we´re on a content edit form. 215 * 216 * _gin_is_content_form() is replaced by 217 * \Drupal::classResolver(GinContentForm::class)->isContentForm(). 218 */ 219 public function isContentForm($form = NULL, $form_state = NULL, $form_id = NULL) { changed this line in version 5 of the diff
added 1 commit
- 90da476b - Do not enable the content form for taxonomy terms
- src/GinContentForm.php 0 → 100644
2 3 namespace Drupal\gin; 4 5 use Drupal\Core\DependencyInjection\ContainerInjectionInterface; 6 use Drupal\Core\Extension\ModuleHandlerInterface; 7 use Drupal\Core\Form\FormStateInterface; 8 use Drupal\Core\Routing\RouteMatchInterface; 9 use Drupal\Core\Session\AccountInterface; 10 use Drupal\Core\StringTranslation\StringTranslationTrait; 11 use Drupal\Core\Theme\ThemeManagerInterface; 12 use Symfony\Component\DependencyInjection\ContainerInterface; 13 14 /** 15 * Service to handle content form overrides. 16 */ 17 class GinContentForm implements ContainerInjectionInterface { Could we please rename this to something not ending with "Form"? Mabye GinContentFormHelper?
Edited by Hristo Chonovchanged this line in version 7 of the diff
added 7 commits
-
24aaa3cc...a382c0c9 - 6 commits from branch
project:8.x-3.x
- c0a02038 - Merge branch '8.x-3.x' into 3188521-improve-content-form
-
24aaa3cc...a382c0c9 - 6 commits from branch
- gin.api.php 0 → 100644
added 43 commits
-
9f438dab...9c91c8b9 - 31 commits from branch
project:8.x-3.x
- 4c5a37f8 - Apply 3188521-8.patch.
- c5e0081d - Use the page--node template when using the node content form.
- 9455f287 - Specify necessary node form theme and library.
- b96f5af9 - Ensure correct settings for advanced, meta and revision form elements.
- 1d7a3e30 - TEMPORARY: Demonstrate node content form for taxonomy terms.
- 667fcfe5 - move functionality to service
- 04dd1bf8 - update api doc
- e1df6a34 - addressed issues from review by chr.fritsch
- 9b2f23ff - Do not enable the content form for taxonomy terms
- bb156006 - Renamed class
- 10ee8d93 - missed renaming file
- b1cdc6bd - fix grammar and examples in gin.api.php
Toggle commit list-
9f438dab...9c91c8b9 - 31 commits from branch
added 45 commits
-
b1cdc6bd...7e1d2f6a - 42 commits from branch
project:8.x-3.x
- b8adb777 - Merge branch '8.x-3.x-source' into 3188521-improve-content-form
- e572911f - Apply gin.theme changes from issue
- 9e59d959 - Apply changes from source branch
Toggle commit list-
b1cdc6bd...7e1d2f6a - 42 commits from branch
added 9 commits
- fdc45b66 - Safari linear-gradient in Darkmode
- d1730518 - Issue #3219236 by Harish1688: layout width issue in responsiveness on mobile/small device
- 98abac79 - Gin sticky mobile fix
- e88d495d - Revert #3219236
- a68636db - Issue #3264207: Entity edit link in meta region only works for nodes
- 8682fb03 - move functionality to service
- e553dba6 - addressed issues from review by chr.fritsch
- 7b5bc69c - Renamed class
- 0128c3d6 - Apply gin.theme changes from issue
Toggle commit list
Please register or sign in to reply