Function goose_eggs::drupal::get_updated_build_id
source · [−]Expand description
Extract an updated build_id from a form.
After certain form actions, such as uploading a file, Drupal can change the build_id
. Requires the original
build_id
.
use goose_eggs::drupal::get_updated_build_id;
let build_id = "form-jsirb7DiRiBC09VrCJRfj-D1z6kjzX-sMqUgHmM_bCs";
let form_snippet = r#"{"command":"update_build_id","old":"form-jsirb7DiRiBC09VrCJRfj-D1z6kjzX-sMqUgHmM_bCs","new":"form-0VJ1MsfQR17RKlwarp_Rh_wMzbmjMlJc1SX_oPc0Bkc"}"#;
let updated_build_id = get_updated_build_id(form_snippet, build_id);
assert_eq!(updated_build_id, "form-0VJ1MsfQR17RKlwarp_Rh_wMzbmjMlJc1SX_oPc0Bkc");