Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sending more than 1 patroninformation query #6

Open
Stan-librarian opened this issue Nov 23, 2017 · 2 comments
Open

Sending more than 1 patroninformation query #6

Stan-librarian opened this issue Nov 23, 2017 · 2 comments

Comments

@Stan-librarian
Copy link

Stan-librarian commented Nov 23, 2017

Hi,

I'm sending 4 times the patroninformation query, as recommended :

$query = $mysip->msgPatronInformation('none');
echo '<b>Requête :</b> ' . $query . '<br />' ;
$result = $mysip->get_message($query) ;
echo '<b>Résultat :</b> ' . $result . '<hr />' ;
$query = $mysip->msgPatronInformation('charged');
echo '<b>Requête :</b> ' . $query . '<br />' ;
$result = $mysip->get_message($query) ;
echo '<b>Résultat :</b> ' . $result . '<hr />' ;
$query = $mysip->msgPatronInformation('hold');
echo '<b>Requête :</b> ' . $query . '<br />' ;
$result = $mysip->get_message($query) ;
echo '<b>Résultat :</b> ' . $result . '<hr />' ;
$query = $mysip->msgPatronInformation('overdue');
echo '<b>Requête :</b> ' . $query . '<br />' ;
$result = $mysip->get_message($query) ;
echo '<b>Résultat :</b> ' . $result . '<hr />' ;

but I get a result only for the first one :

Requête : 6300120171123 123051 AOJL|AATEST03|BP1|BQ5|AY0AZF25E
Résultat : 64 00120171123 123051000100000002000000000001AOJL |AATEST03|AETEST, Mineur - Your subscription expires on 01/07/2018|BZ5|CA30|CB20|BLY|CQN|BHEUR|BV0.0|CC0.0|BDAdresse Ligne 1 Adresse Ligne 3, Adresse Ligne 2, Adresse Ligne 3|BE|BF03 12 34 56 78|DG|DH|DI|DJ|DK|DL|PD11/15/2005|PCFRAN| 
Requête : 6300120171123 123052 Y AOJL|AATEST03|BP1|BQ5|AY1AZF223
Résultat : 
Requête : 6300120171123 123052Y AOJL|AATEST03|BP1|BQ5|AY2AZF222
Résultat : 
Requête : 6300120171123 123052 Y AOJL|AATEST03|BP1|BQ5|AY3AZF221
Résultat :

I don't see why...

I'm a librarian, so maybe I'm missing something obvious. If that's so, I'm sorry…

@Stan-librarian
Copy link
Author

Each one of the queries gets a result if I launch it alone. But when I launch 2 queries in a row, the second one doesn't get a result.

@Stan-librarian
Copy link
Author

I found the solution : in fact my ILS doesnt send the AY and AZ fields. So the CRC control failed each time.
So I modified the function _check_crc($message) by adding the following at the beginning :
if(substr($message, -6, 2) != 'AZ'){return true;}
and that works!

I imagine I could have added false parameters to the calls
return $this->_returnMessage();

Maybe there should be a configuration option to disable error handling…

However, I still don't understand why a single query works but not many…

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant