Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
This functionality in particular allows user to search a specific wish list with a purpose to access/modify it. The user can then alter/modify the specific wishlist according as per personal requirements.
Implementation steps involved:
- This functionality makes use of the Form and Search APIs to include the following components for executing a functional and effective search:
- Search submit button: To execute the required search.
- Search results list: Displaying the expected search results.
- Search text box (textbox): If there are keywords, check for the user, wish list title, or address matches.
- Additionally, the Database API would involve the following facets:
- $db = \Drupal::database(): Gets the connection object for the specified database key and target.
- $query->condition(db_or()
->condition('u.name','%'.$keywords.'%','LIKE')
->condition('w.title','%'.$keywords.'%','LIKE')
->condition('w.address','%'.$keywords.'%',
'LIKE')) :
makes three queries and returns a new DatabaseCondition.
- $data=$db→select('uc_wishlist','wid')→fields('wid')→execute(): Checks if wish list is not private.
- The Configuration API would be used to configure the fields.
Comments
Comment #2
chiranjeeb2410 CreditAttribution: chiranjeeb2410 at Google Summer of Code commentedComment #3
naveenvalechaComment #4
chiranjeeb2410 CreditAttribution: chiranjeeb2410 at Google Summer of Code commentedComment #5
naveenvalechaClosing this as duplicate in favor of #2889425: Porting Uc wishlist module to Drupal 8 | Phase 1 #2880447: Porting Uc wishlist module to Drupal 8 | Phase 2 and #2880444: Porting Uc wishlist module to Drupal 8 | Phase 3