AI - always be willing to challenge it and other digital experts

"I'm sorry Dave, but I can't do that."

ChatGPT4-o has memory, so you can continue from a response without repeating the original question. This comes in handy when challenging the tool about its answer:

Me: Drupal how do I add a custom submit handler to a form so that the original submit handler can execute afterwards?

GPT: In Drupal, if you want to add a custom submit handler to a form but still allow the original submit handler to execute afterwards, you can do so by using the #submit property of the form. You don’t need to remove the original handler—just append your custom handler to the list of submit handlers.

Me: If submit handlers are executed sequentially why would adding mine to the end of the array cause it to execute first?

GPT: You’re correct! I misspoke in my earlier explanation. Submit handlers in Drupal are executed in the order they are added to the #submit array, meaning handlers added later will execute after those added earlier. So if you add your submit handler to the end of the #submit array, it will execute last, not first.

I've long recognized the limitations of computers spitting back information it has been programmed to "comprehend." A great example is Google Translation. Try translating an idiomatic sentence and then reversing the languages so that it translates its translation back into your language. The results often do not represent you intended meaning.

The ChatGPT example is a fairly innocuous error, despite being 180° off. I did have an occasion, though, where the error was potential deadly.

GPS was giving us turn-by-turn directions in a remote part of Iceland one very dark night. It said to take the first turning off a traffic circle (well...roundabout...there wouldn't have been traffic there, ever) and continue for a mile. I took the turn, and after about 200 yards I stopped because even in the darkness, the road ahead looked even darker, and I had this uneasy gut feeling. I got out of the car and walked another 100 feet and discovered the edge of a cliff, no guard rail, with 25-50 foot drop.

It turned out that a new turn was added to the roundabout and wasn't yet in the GPS database.


Type:
Comment Block
Tags: