Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Group 1: Convert functions in tripal.module file #17

Closed
22 of 32 tasks
Tracked by #1
laceysanderson opened this issue Jan 5, 2020 · 11 comments
Closed
22 of 32 tasks
Tracked by #1

Group 1: Convert functions in tripal.module file #17

laceysanderson opened this issue Jan 5, 2020 · 11 comments

Comments

@laceysanderson
Copy link
Member

laceysanderson commented Jan 5, 2020

This was started and almost completed by @shawnawsu. The intent is to convert all functions in the tripal 3 tripal.module file to Drupal 8.

Here is the list of functions from Tripal 3:

  • tripal_views_api(): removed
  • tripal_init(): replaced by tripal_preprocess_html
  • tripal_menu_alter(&$items): check if this was ported
  • tripal_menu(): check that this is complete using this tutorial
  • tripal_access_user_files($op, $uid, $fid = NULL)
  • tripal_accesss_user_collections($uid)
  • tripal_users_autocomplete($string): db_select is deprecated
  • tripal_access_user_data($uid)
  • tripal_permission() check that all permissions were ported
  • tripal_theme($existing, $type, $theme, $path): the function exists. We will add theme defn as they are needed.
  • tripal_coder_ignore(): check if this is still needed
  • tripal_libraries_info()
  • tripal_admin_paths()
  • tripal_menu_local_tasks_alter(&$data, $router_item, $root_path)
  • tripal_shortcut_default_set($account): do we want another dependency to keep these? perhaps we just need to add an if module is installed then do this.
  • TripalBundle_load($bundle_type, $reset = FALSE)
  • TripalEntity_load($id, $reset = FALSE)
  • tripal_import_api()
  • tripal_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id): does not yet work
  • tripal_form_alter(&$form, $form_state, $form_id): check after TripalField implementation that this works. it removes fields with no widgets from the tripal entity add/edit form.
  • tripal_check_new_fields($bundle_name): upgraded although it's called API functions are not.
  • tripal_block_info(): Blocks are now plugins
  • tripal_block_view($delta = '')
  • tripal_block_save($delta = '', $edit = array())
  • tripal_block_configure($delta = '')
  • tripal_cron(): drupal 8 hook_cron
  • tripal_element_info() moved over to classes
  • tripal_html5_file_process($element, $form_state, $complete_form)
  • tripal_html5_file_validate($element, &$form_state)
  • tripal_html5_file_value($element, $input = FALSE, &$form_state)
  • tripal_field_display_TripalEntity_alter(&$display, $context)
  • tripal_field_group_table_rows_alter(&$element, &$children)
@laceysanderson
Copy link
Member Author

laceysanderson commented Jan 5, 2020

Since this can be a bit overwhelming, I've broken it down into sub-issues with specific documentation:

Items not broken into issues... if you feel these need their own issue, feel free to create one and tag it with "group 1". Otherwise, feel free to comment in this thread.

  • tripal_users_autocomplete($string): db_select is deprecated
  • tripal_coder_ignore(): check if this is still needed
  • TripalBundle_load($bundle_type, $reset = FALSE): check if this is still needed. Seems to be handled by the Drupal 8 entity api
  • TripalEntity_load($id, $reset = FALSE): check if this is still needed. Seems to be handled by the Drupal 8 entity api
  • tripal_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id): does not yet work
  • tripal_form_alter(&$form, $form_state, $form_id): check after TripalField implementation that this works. it removes fields with no widgets from the tripal entity add/edit form.
  • tripal_field_display_TripalEntity_alter(&$display, $context)
  • tripal_field_group_table_rows_alter(&$element, &$children)

@laceysanderson laceysanderson changed the title Convert functions in tripal.module file Group 1: Convert functions in tripal.module file Jan 5, 2020
@ng29
Copy link

ng29 commented Oct 9, 2020

Heya @laceysanderson ,

I can give it a shot on this. (Though incase any queries will ping ya)

Cheers.

@laceysanderson
Copy link
Member Author

We're happy to have you 😃 Just checking in: how are things going? Any questions?

@ng29
Copy link

ng29 commented Oct 14, 2020

We're happy to have you 😃 Just checking in: how are things going? Any questions?

@laceysanderson Can i get some more info what needs to be achieved in this issue so that can start it , as it seems kinda Giant rock.

And all functions need to be catered under one PR or in chunks ? .

@laceysanderson
Copy link
Member Author

laceysanderson commented Oct 14, 2020

In comment #17 (comment) I split out a bit of the work into other issues so you don't need to worry about those functions. Instead, for this issue you should focus on the following:

  • tripal_users_autocomplete($string): db_select is deprecated
  • tripal_coder_ignore(): check if this is still needed
  • TripalBundle_load($bundle_type, $reset = FALSE): check if this is still needed. Seems to be handled by the Drupal 8 entity api
  • TripalEntity_load($id, $reset = FALSE): check if this is still needed. Seems to be handled by the Drupal 8 entity api
  • tripal_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id): does not yet work
  • tripal_form_alter(&$form, $form_state, $form_id): check after TripalField implementation that this works. it removes fields with no widgets from the tripal entity add/edit form.
  • tripal_field_display_TripalEntity_alter(&$display, $context)
  • tripal_field_group_table_rows_alter(&$element, &$children)

As far as how you arrange it, that is completely up to you! Personally, I would start with confirming whether tripal_coder_ignore(), TripalBundle_load() and TripalEntity_load() are even still needed. Next I would look at tripal_users_autocomplete(). The last four seem like they might be related to the field implementation, in which case they cannot be done quite yet. If this ends up being the case then just comment on #28.

@ng29
Copy link

ng29 commented Oct 14, 2020

In comment #17 (comment) I split out a bit of the work into other issues so you don't need to worry about those functions. Instead, for this issue you should focus on the following:

  • tripal_users_autocomplete($string): db_select is deprecated
  • tripal_coder_ignore(): check if this is still needed
  • TripalBundle_load($bundle_type, $reset = FALSE): check if this is still needed. Seems to be handled by the Drupal 8 entity api
  • TripalEntity_load($id, $reset = FALSE): check if this is still needed. Seems to be handled by the Drupal 8 entity api
  • tripal_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id): does not yet work
  • tripal_form_alter(&$form, $form_state, $form_id): check after TripalField implementation that this works. it removes fields with no widgets from the tripal entity add/edit form.
  • tripal_field_display_TripalEntity_alter(&$display, $context)
  • tripal_field_group_table_rows_alter(&$element, &$children)

As far as how you arrange it, that is completely up to you! Personally, I would start with confirming whether tripal_coder_ignore(), TripalBundle_load() and TripalEntity_load() are even still needed. Next I would look at tripal_users_autocomplete(). The last four seem like they might be related to the field implementation, in which case they cannot be done quite yet. If this ends up being the case then just comment on #28.

Thanks alot for such detailed explaination, and as far as i understood our main concern is upper 4 functions in your above comment.

Also could you please guide me that from i have to confirm (any link to docs or something) and directory path where these functions need to omitted or any other operation required.

Cheers

@laceysanderson
Copy link
Member Author

Thanks alot for such detailed explaination, and as far as i understood our main concern is upper 4 functions in your above comment.

Exactly :-)

Also could you please guide me that from i have to confirm (any link to docs or something) and directory path where these functions need to omitted or any other operation required.

All the functions should all be in https://github.com/tripal/t4d8/blob/9.x-4.x/tripal/tripal.module (although I see the autocomplete is missing 🤷‍♀️ ) This task requires digging through the new Drupal 8/9 documentation to see if they are still needed. This was the function that they accomplished in Drupal 7:

  • tripal_users_autocomplete(): provided an autocomplete for form fields though I'm not sure why we needed a special one for tripal. perhaps it has to do with Chado contacts?
  • TripalBundle_load() and TripalEntity_load(): these were related to arguements in hook_menu. Specifically, they ensured that when the bundle_id and/or entity_id were in the path, the appropriate object was loaded and passed to the callback.
  • tripal_coder_ignore(): this is an implementation of hook_code_ignore() and was related to ensuring that our own ignore rules for the Drupal code module were picked up. This helps for syntax detecting since we have some API functions which require a certain non-drupal syntax.

@ng29
Copy link

ng29 commented Oct 14, 2020

Thanks alot for such detailed explaination, and as far as i understood our main concern is upper 4 functions in your above comment.

Exactly :-)

Also could you please guide me that from i have to confirm (any link to docs or something) and directory path where these functions need to omitted or any other operation required.

All the functions should all be in https://github.com/tripal/t4d8/blob/9.x-4.x/tripal/tripal.module (although I see the autocomplete is missing 🤷‍♀️ ) This task requires digging through the new Drupal 8/9 documentation to see if they are still needed. This was the function that they accomplished in Drupal 7:

  • tripal_users_autocomplete(): provided an autocomplete for form fields though I'm not sure why we needed a special one for tripal. perhaps it has to do with Chado contacts?
  • TripalBundle_load() and TripalEntity_load(): these were related to arguements in hook_menu. Specifically, they ensured that when the bundle_id and/or entity_id were in the path, the appropriate object was loaded and passed to the callback.
  • tripal_coder_ignore(): this is an implementation of hook_code_ignore() and was related to ensuring that our own ignore rules for the Drupal code module were picked up. This helps for syntax detecting since we have some API functions which require a certain non-drupal syntax.

Ah, now I am getting somethings in my head... and it needs a high level of concentration to check these out.
But the main problem is that I am not much into Drupal stuff so might not be able to decide the exact use case and regression of omitting some function, too.

So what's your opinion, if we can do it together and you can guide me on slack/another mode.

Cheers

@laceysanderson
Copy link
Member Author

Feel free to ask me questions either here or on slack :-) The easiest one to track down is likely hook_coder_ignore() so I would start there.

@ng29
Copy link

ng29 commented Oct 14, 2020

Feel free to ask me questions either here or on slack :-) The easiest one to track down is likely hook_coder_ignore() so I would start there.

Okay cool, will see if i got some guts to nail this down

@laceysanderson
Copy link
Member Author

Not Needed:
tripal_form_field_ui_field_edit_form_alter(&$form, &$form_state, $form_id): handled by fields.
tripal_form_alter(&$form, $form_state, $form_id): TripalField implementation does this.
tripal_field_display_TripalEntity_alter(&$display, $context)
tripal_field_group_table_rows_alter(&$element, &$children)

Remaining:
#21 Default Tripal Shortcuts (discussion)

Since there is only a single thing left and it has it's own issue, I'm closing this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants