Subject: | |
Date: | Sat, 11 Jul 2020 22:25:03 +0300 |
To: | bug-WWW-Mechanize-Query [...] rt.cpan.org |
From: | Nikolay Chegodaev <nickcheg1 [...] gmail.com> |
Hi San,
If I used the wrong name to address module maintainer, please accept my
apologies.
My name is Nikolay. I am a Perl enthusiast and worked as Perl Developer for
5 years. I am writing to you in this email because I have taken from the
page advised to me by Dan Book. He told me that you as a module maintainer
may help to publish changes for the module to reflect the recent changes in
Mojo::DOM, WWW::Mechanize::Query is dependent on Mojo::DOM or so it seems.
My perl version is 5.26 and Ubuntu version is 18.04. The module is a really
good approach and I do not think it would be good to leave it like this.
I have tried to use https://github.com/gitpan/WWW-Mechanize-Query to
implement a really small project on Perl v5.26.1 and encountered a number
of errors which prevent me from using the module. In fact errors probably
reflect recent changes in https://metacpan.org/pod/Mojo::DOM module which
is a dependence for WWW-Mechanize-Query.
I have made some testing changes to the module Query.pm on my localhost,
which solved the issue for me. *Do you mind if I share them public and
commit them to the repository, with your code review of course?*
The changes are seem to be small and mostly related to sub input of the
Query.pm module ( link to Gitpan project
<https://github.com/gitpan/WWW-Mechanize-Query/blob/master/lib/WWW/Mechanize/Query.pm>
)
for Perl v5.26.1 and Mojo::DOM <https://metacpan.org/pod/Mojo::DOM> the
changes list for now only seem to include the following:
1) change all attrs calls to attr call - for example $ele->attrs( 'type' )
to $ele->attr( 'type' )
2) change ->type call to ->tag call at the place where we check if the type
of the element submitted is correct, but the information we check contains
in ->tag attribute, not in the ->type attribute. -> type attribute only
contains a "tag" in it since select or text boxes are considered like so in
the new edition of Mojo::DOM it seems. For example: *} elsif ( $ele->type
=~ /select/i ) { should be changed to } elsif ( $ele->tag =~ /select/i ) {*
3) change $dom->to_xml to just just dom at the response of the sub input
for example: $self->update_html( $dom->to_xml ); to $self->update_html(
$dom); to_xml seem not to be used in Mojo::DOM as far as I tested and it
seems like just $dom already contains the xml content
Please kindly find attached Query.pm with the changes - I have taken an
audacity to change the version, please accept apologies if I should not.
The attached module reflects the changes mentioned in the fields 1)-3). I
have tested them on my localhost - seems working. Also while the module
being used in combo with the WWW::Mechanize there are issues with the
posting the forms - older format of form fields in there so debugging it at
the moment, while working on my script/snippet - so probably a second fix
to follow.
Thanks.
Kind Regards,
Nikolay.
Message body is not shown because sender requested not to inline it.