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.
We should encourage users to use good database practice and only bring in the data they need with database queries rather than the generic SELECT *. To a newcomer the layout of the query can be confusing if they don't understand that the first part of ->fields is the table name and that we need to add the name of the fields we want as an array.
Comment | File | Size | Author |
---|---|---|---|
#39 | dbtng_select_fields-2073851-39.patch | 2.87 KB | navneet0693 |
| |||
#39 | interdiff-39.txt | 1.55 KB | navneet0693 |
#37 | Screen Shot new result set.png | 40.84 KB | Manav |
#37 | Screen Shot old result set.png | 33.84 KB | Manav |
#35 | dbtng_select_fields-2073851-35.patch | 2.82 KB | navneet0693 |
|
Comments
Comment #1
mexicoder CreditAttribution: mexicoder commentedPatch to select only certain fields in the dbtng_example db_select.
Comment #4
minakshiPh CreditAttribution: minakshiPh at Iksula commentedRe-rolled the patch.
Thanks!!!
Comment #6
minakshiPh CreditAttribution: minakshiPh at Iksula commentedTest has passed.
Kindly review.
Thanks!
Comment #7
Manav CreditAttribution: Manav as a volunteer and at QED42 commentedComment #8
Manav CreditAttribution: Manav as a volunteer and at QED42 commentedPatch failed locally for latest 7.x-1.x branch, even tested on simpletest.me shows the same result.
Comment #9
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #10
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedSuggestion is appreciable. Re-rolled the patch in #1
Comment #11
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #13
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #14
Mile23Retesting #10.
Comment #16
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedRetesting, making sure that testing has correct parameters.
Comment #18
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #20
Berdirthis makes no sense.
token in core is *not* a module, it's just an API. If you do not depend on the token module project/contrib, then you must not have a dependency at all.
Comment #21
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #22
MixologicYou had your namespacing incorrect. If you depend on a module, then the namespacing should be in the format of
dependencies[] = <projectname>:<modulename>
Where projectname is the name of the project as hosted by drupal.org, and modulename is the name of the module within the project, which is sometimes, but not always the same. In this case your dependencies should be:
Comment #23
Mixologic(oh, just re-read what berdir said, yes, if you do not need the token *module* then you dont need it as a dependency)
Comment #24
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #26
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #27
Mile23We want to add back this comment as well.
Comment #28
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedAdded a child issue: #2841202: Remove dependency declaration on token in token_example.info. to update token_example.info separately. As we learned on IRC via Mixologic that
Comment #29
Mile23OK. Fixed the dependencies issue for CI in #2841202: Remove dependency declaration on token in token_example.info. so we can run tests.
Now we don't want to change this dependency at all.
Comment #30
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedRe-testing #10
Comment #31
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedAnd here it passes: https://www.drupal.org/pift-ci-job/566438
Comment #32
Mile23#10 has this.
Comment #33
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #34
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commented@Mile23 ouch! missed that. Removing it.
Comment #35
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedComment #36
Manav CreditAttribution: Manav as a volunteer and at QED42 commentedComment #37
Manav CreditAttribution: Manav as a volunteer and at QED42 commentedHi @navneet0693
Patch is works fine for me. The only issue is coding standard. Please check and submit this patch again. Attaching 2 screen-shot for the same.
PHP version: 5.6
Mysql: 5.5
Drupal: 7.x
Comment #38
Manav CreditAttribution: Manav as a volunteer and at QED42 commentedComment #39
navneet0693 CreditAttribution: navneet0693 as a volunteer and at QED42 commentedThanks @Manav, for pointing out what i missed :)
Comment #40
Manav CreditAttribution: Manav as a volunteer and at QED42 commentedThe last submitted patch #39 is works fine for me. showing the expected result according to the issue description.
Drupal: 7.x
PHP ver: 5.6
Mysql: 5.5
@navneet0693 for your quick fixes. :)
Comment #41
Manav CreditAttribution: Manav as a volunteer and at QED42 commentedComment #42
valthebaldCommitted and pushed to 7.x-1.x. Thanks everyone!