statonlab / tripal_hq

provides a user and administrative dashboard for Chado content creation
GNU General Public License v3.0
2 stars 0 forks source link

specifying object standard class in `tripal_hq_save_submission` breaks submit #91

Closed bradfordcondon closed 5 years ago

bradfordcondon commented 5 years ago

tripal_hq_save_submission was given a type for the object (stdObj). but the passed object is TripalEntity.

almasaeed2010 commented 5 years ago

Can we not type hint it? I can see I use case for this function where we pass a fake object to it.

bradfordcondon commented 5 years ago

also i need to specify that php 5.6 is as requirement because of the type hints

bradfordcondon commented 5 years ago
/**
 * Save the fully constructed entity as a submission.
 *
 * @param \TripalEntity $entity
 *   A tripal entity object.
 * @param int $submission_id
 *   The HQ submission ID.
 *
 * @return string
 *   The submission id, or FALSE if error.
 */
function tripal_hq_save_submission(TripalEntity $entity, int $submission_id = NULL) {

this appears to work

almasaeed2010 commented 5 years ago

Yeah that should work since we currently always give it a TripalEntity.

almasaeed2010 commented 5 years ago

92 fixes this issue

bradfordcondon commented 5 years ago

merged #92 closing, thanks