[DigitalPoint] PWA

[DigitalPoint] PWA 1.2.3

No permission to download
Hi @digitalpoint

I am receiving numerous number of errors in my adminCP

error code:
Code:
ErrorException: [E_DEPRECATED] parse_str(): Passing null to parameter #1 ($string) of type string is deprecated src/addons/DigitalPoint/PWA/XF/WebManifestRenderer.php:26
Generated by: NICK97 Aug 17, 2023 at 7:36 PM
Stack trace
#0 [internal function]: XF::handlePhpError(8192, '[E_DEPRECATED] ...', '/home/thkw8765/...', 26)
#1 src/addons/DigitalPoint/PWA/XF/WebManifestRenderer.php(26): parse_str(NULL, NULL)
#2 src/XF/WebManifestRenderer.php(41): DigitalPoint\PWA\XF\WebManifestRenderer->getResponseBody()
#3 webmanifest.php(14): XF\WebManifestRenderer->render(Object(XF\Style), Object(XF\Language))
#4 {main}
Request state
array(4) {
  ["url"] => string(16) "/webmanifest.php"
  ["referrer"] => string(38) "https://xen-shop.com/account/reactions"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

here a screenshot
IMG_0267.webp
 
Hi @digitalpoint

I am receiving numerous number of errors in my adminCP

error code:
Code:
ErrorException: [E_DEPRECATED] parse_str(): Passing null to parameter #1 ($string) of type string is deprecated src/addons/DigitalPoint/PWA/XF/WebManifestRenderer.php:26
Generated by: NICK97 Aug 17, 2023 at 7:36 PM
Stack trace
#0 [internal function]: XF::handlePhpError(8192, '[E_DEPRECATED] ...', '/home/thkw8765/...', 26)
#1 src/addons/DigitalPoint/PWA/XF/WebManifestRenderer.php(26): parse_str(NULL, NULL)
#2 src/XF/WebManifestRenderer.php(41): DigitalPoint\PWA\XF\WebManifestRenderer->getResponseBody()
#3 webmanifest.php(14): XF\WebManifestRenderer->render(Object(XF\Style), Object(XF\Language))
#4 {main}
Request state
array(4) {
  ["url"] => string(16) "/webmanifest.php"
  ["referrer"] => string(38) "https://xen-shop.com/account/reactions"
  ["_GET"] => array(0) {
  }
  ["_POST"] => array(0) {
  }
}

here a screenshot
View attachment 290032
Look like something in PHP 8.1 or higher...

In the DigitalPoint\PWA\XF\WebManifestRenderer.php file, if you change this:

PHP:
parse_str(parse_url($this->app()->request()->getReferrer(), PHP_URL_QUERY), $query);

...to this:
PHP:
parse_str(parse_url($this->app()->request()->getReferrer(), PHP_URL_QUERY) ?: '', $query);

...does that sort it out?
 
When this is enabled, on posting I get this error:

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'error_count' in 'field list' in src/XF/Db/AbstractStatement.php at line 228
 
Also receiving the below error. XF version 2.2.12 - PHP 8.1 Using latest PWA 1.2.0

XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'error_count' in 'field list' in src/XF/Db/AbstractStatement.php at line 230
 
After v1.2.0 initial install, I get the following error;

Code:
Server error log
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'error_count' in 'field list' src/XF/Db/AbstractStatement.php:230
Generated by: glennmcc Aug 24, 2023 at 10:57
Stack trace
UPDATE  `xf_user_push_subscription` SET `last_seen` = ?, `error_count` = ? WHERE endpoint_hash = ?
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(324): XF\Db\AbstractAdapter->query('UPDATE  `xf_use...', Array)
#5 src/addons/DigitalPoint/PWA/XF/Service/PushNotification.php(28): XF\Db\AbstractAdapter->update('xf_user_push_su...', Array, 'endpoint_hash =...', 'a9aeceadad638fa...')
#6 src/XF/Service/PushNotification.php(176): DigitalPoint\PWA\XF\Service\PushNotification->handleResults(Object(Generator))
#7 src/XF/Service/PusherTrait.php(194): XF\Service\PushNotification->sendNotifications()
#8 src/XF/Repository/UserAlert.php(165): XF\Service\Alert\Pusher->push()
#9 src/XF/Repository/UserAlert.php(103): XF\Repository\UserAlert->insertAlert(36966, 42456, 'glennmcc', 'post', 4155312, 'reaction', Array, Array)
#10 src/XF/Reaction/AbstractHandler.php(192): XF\Repository\UserAlert->alertFromUser(Object(SV\DailyStatistics\XF\Entity\User), Object(SV\DailyStatistics\XF\Entity\User), 'post', 4155312, 'reaction', Array)
#11 src/XF/Repository/Reaction.php(203): XF\Reaction\AbstractHandler->sendReactionAlert(Object(SV\DailyStatistics\XF\Entity\User), Object(SV\DailyStatistics\XF\Entity\User), 4155312, Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 4)
#12 src/XF/Repository/Reaction.php(144): XF\Repository\Reaction->insertReaction(4, 'post', 4155312, Object(SV\DailyStatistics\XF\Entity\User), true, false)
#13 src/XF/ControllerPlugin/Reaction.php(67): XF\Repository\Reaction->reactToContent(4, 'post', 4155312, Object(SV\DailyStatistics\XF\Entity\User), true)
#14 src/XF/ControllerPlugin/Reaction.php(21): XF\ControllerPlugin\Reaction->actionToggleReaction(Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 'posts/reactions', 'posts')
#15 src/XF/ControllerPlugin/Reaction.php(14): XF\ControllerPlugin\Reaction->actionReact(Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 'posts', 'posts/react', 'posts/reactions')
#16 src/XF/Pub/Controller/Post.php(381): XF\ControllerPlugin\Reaction->actionReactSimple(Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 'posts')
#17 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'React', Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\Post), NULL)
#19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\Post), NULL)
#20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#22 src/XF.php(524): XF\App->run()
#23 index.php(20): XF::runApp('XF\\Pub\\App')
#24 {main}
 
After v1.2.0 initial install, I get the following error;

Code:
Server error log
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'error_count' in 'field list' src/XF/Db/AbstractStatement.php:230
Generated by: glennmcc Aug 24, 2023 at 10:57
Stack trace
UPDATE  `xf_user_push_subscription` SET `last_seen` = ?, `error_count` = ? WHERE endpoint_hash = ?
------------

#0 src/XF/Db/Mysqli/Statement.php(198): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(41): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(56): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(96): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(324): XF\Db\AbstractAdapter->query('UPDATE  `xf_use...', Array)
#5 src/addons/DigitalPoint/PWA/XF/Service/PushNotification.php(28): XF\Db\AbstractAdapter->update('xf_user_push_su...', Array, 'endpoint_hash =...', 'a9aeceadad638fa...')
#6 src/XF/Service/PushNotification.php(176): DigitalPoint\PWA\XF\Service\PushNotification->handleResults(Object(Generator))
#7 src/XF/Service/PusherTrait.php(194): XF\Service\PushNotification->sendNotifications()
#8 src/XF/Repository/UserAlert.php(165): XF\Service\Alert\Pusher->push()
#9 src/XF/Repository/UserAlert.php(103): XF\Repository\UserAlert->insertAlert(36966, 42456, 'glennmcc', 'post', 4155312, 'reaction', Array, Array)
#10 src/XF/Reaction/AbstractHandler.php(192): XF\Repository\UserAlert->alertFromUser(Object(SV\DailyStatistics\XF\Entity\User), Object(SV\DailyStatistics\XF\Entity\User), 'post', 4155312, 'reaction', Array)
#11 src/XF/Repository/Reaction.php(203): XF\Reaction\AbstractHandler->sendReactionAlert(Object(SV\DailyStatistics\XF\Entity\User), Object(SV\DailyStatistics\XF\Entity\User), 4155312, Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 4)
#12 src/XF/Repository/Reaction.php(144): XF\Repository\Reaction->insertReaction(4, 'post', 4155312, Object(SV\DailyStatistics\XF\Entity\User), true, false)
#13 src/XF/ControllerPlugin/Reaction.php(67): XF\Repository\Reaction->reactToContent(4, 'post', 4155312, Object(SV\DailyStatistics\XF\Entity\User), true)
#14 src/XF/ControllerPlugin/Reaction.php(21): XF\ControllerPlugin\Reaction->actionToggleReaction(Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 'posts/reactions', 'posts')
#15 src/XF/ControllerPlugin/Reaction.php(14): XF\ControllerPlugin\Reaction->actionReact(Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 'posts', 'posts/react', 'posts/reactions')
#16 src/XF/Pub/Controller/Post.php(381): XF\ControllerPlugin\Reaction->actionReactSimple(Object(TickTackk\ChangeContentOwner\XF\Entity\Post), 'posts')
#17 src/XF/Mvc/Dispatcher.php(352): XF\Pub\Controller\Post->actionReact(Object(XF\Mvc\ParameterBag))
#18 src/XF/Mvc/Dispatcher.php(259): XF\Mvc\Dispatcher->dispatchClass('XF:Post', 'React', Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\Post), NULL)
#19 src/XF/Mvc/Dispatcher.php(115): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(TickTackk\ChangeContentOwner\XF\Pub\Controller\Post), NULL)
#20 src/XF/Mvc/Dispatcher.php(57): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#21 src/XF/App.php(2483): XF\Mvc\Dispatcher->run()
#22 src/XF.php(524): XF\App->run()
#23 index.php(20): XF::runApp('XF\\Pub\\App')
#24 {main}
Ya, see above… I didn’t realize the column it’s mucking with wasn’t added until XF 2.2.13.

Because of that, for the next version I’ve upped the required version of XF to be 2.2.13 or higher.
 
First, thanks for sharing this!! Great work!

Would caching be possible, or even reasonable? For example, caching the last XX pages for surfing should the connection drop. And/or, continue an upload/post in the background once the connection resumes? Perhaps the user is notified once the background action completes?
 
First, thanks for sharing this!! Great work!

Would caching be possible, or even reasonable? For example, caching the last XX pages for surfing should the connection drop. And/or, continue an upload/post in the background once the connection resumes? Perhaps the user is notified once the background action completes?
That’s going to be outside the scope of what I’m willing to do here. Making the site viable (with or without PWA) without a stable Internet connection would be a crazy undertaking.

I’m just gonna stick with the idea that you do need Internet of some sort to access/use a XenForo-based site. 😀
 
That’s going to be outside the scope of what I’m willing to do here. Making the site viable (with or without PWA) without a stable Internet connection would be a crazy undertaking.

I’m just gonna stick with the idea that you do need Internet of some sort to access/use a XenForo-based site. 😀
Right on. Never hurts to ask! Thanks again for the awesome add on!
 
Top Bottom