[bd] Medal [Deleted]

raytrails

Well-known member
When using gifs I could just click the medal image to change it, but after starting using svg this is not possible anymore. How do I change the medal image when using svg-files?
 

Gossamer

Active member
I'm also getting the same error others have reported when attempting to add a new medal.
Code:
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'is_svg' in 'field list' src/XF/Db/AbstractStatement.php:228
Generated by: Octi Feb 14, 2020 at 9:04 AM
Stack trace
INSERT  INTO `xf_bdmedal_medal` (`display_order`, `name`, `category_id`, `description`, `user_count`, `last_award_date`, `last_award_user_id`, `last_award_username`, `image_date`, `is_svg`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(221): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#5 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_bdmedal_meda...', Array, false)
#6 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#7 src/XF/Mvc/FormAction.php(69): XF\Mvc\Entity\Entity->save(true, false)
#8 src/XF/Mvc/FormAction.php(187): XF\Mvc\FormAction->XF\Mvc\{closure}(Object(XF\Mvc\FormAction))
#9 src/addons/Xfrocks/Medal/DevHelper/Admin/Controller/Entity.php(120): XF\Mvc\FormAction->run()
#10 src/XF/Mvc/Dispatcher.php(350): Xfrocks\Medal\DevHelper\Admin\Controller\Entity->actionSave(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('Xfrocks\\Medal:M...', 'Save', Object(XF\Mvc\RouteMatch), Object(Xfrocks\Medal\Admin\Controller\Medal), NULL)
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Xfrocks\Medal\Admin\Controller\Medal), NULL)
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#15 src/XF.php(391): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}
Request state
array(4) {
  ["url"] => string(22) "/admin.php?medals/save"
  ["referrer"] => string(39) "https://pandorarp.com/admin.php?medals/"
  ["_GET"] => array(1) {
    ["medals/save"] => string(0) ""
  }
  ["_POST"] => array(6) {
    ["values"] => array(4) {
      ["name"] => string(23) "Crush and Burn [ 2019 ]"
      ["category_id"] => string(1) "1"
      ["description"] => string(47) "Participated in our 2019 run of Crush and Burn!"
      ["display_order"] => string(2) "10"
    }
    ["entity_id"] => string(0) ""
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(18) "/admin.php?medals/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
 

Gossamer

Active member
I'm also getting the same error others have reported when attempting to add a new medal.
Code:
XF\Db\Exception: MySQL statement prepare error [1054]: Unknown column 'is_svg' in 'field list' src/XF/Db/AbstractStatement.php:228
Generated by: Octi Feb 14, 2020 at 9:04 AM
Stack trace
INSERT  INTO `xf_bdmedal_medal` (`display_order`, `name`, `category_id`, `description`, `user_count`, `last_award_date`, `last_award_user_id`, `last_award_username`, `image_date`, `is_svg`) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
------------

#0 src/XF/Db/Mysqli/Statement.php(196): XF\Db\AbstractStatement->getException('MySQL statement...', 1054, '42S22')
#1 src/XF/Db/Mysqli/Statement.php(39): XF\Db\Mysqli\Statement->getException('MySQL statement...', 1054, '42S22')
#2 src/XF/Db/Mysqli/Statement.php(54): XF\Db\Mysqli\Statement->prepare()
#3 src/XF/Db/AbstractAdapter.php(94): XF\Db\Mysqli\Statement->execute()
#4 src/XF/Db/AbstractAdapter.php(221): XF\Db\AbstractAdapter->query('INSERT  INTO `x...', Array)
#5 src/XF/Mvc/Entity/Entity.php(1452): XF\Db\AbstractAdapter->insert('xf_bdmedal_meda...', Array, false)
#6 src/XF/Mvc/Entity/Entity.php(1184): XF\Mvc\Entity\Entity->_saveToSource()
#7 src/XF/Mvc/FormAction.php(69): XF\Mvc\Entity\Entity->save(true, false)
#8 src/XF/Mvc/FormAction.php(187): XF\Mvc\FormAction->XF\Mvc\{closure}(Object(XF\Mvc\FormAction))
#9 src/addons/Xfrocks/Medal/DevHelper/Admin/Controller/Entity.php(120): XF\Mvc\FormAction->run()
#10 src/XF/Mvc/Dispatcher.php(350): Xfrocks\Medal\DevHelper\Admin\Controller\Entity->actionSave(Object(XF\Mvc\ParameterBag))
#11 src/XF/Mvc/Dispatcher.php(261): XF\Mvc\Dispatcher->dispatchClass('Xfrocks\\Medal:M...', 'Save', Object(XF\Mvc\RouteMatch), Object(Xfrocks\Medal\Admin\Controller\Medal), NULL)
#12 src/XF/Mvc/Dispatcher.php(113): XF\Mvc\Dispatcher->dispatchFromMatch(Object(XF\Mvc\RouteMatch), Object(Xfrocks\Medal\Admin\Controller\Medal), NULL)
#13 src/XF/Mvc/Dispatcher.php(55): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#14 src/XF/App.php(2184): XF\Mvc\Dispatcher->run()
#15 src/XF.php(391): XF\App->run()
#16 admin.php(13): XF::runApp('XF\\Admin\\App')
#17 {main}
Request state
array(4) {
  ["url"] => string(22) "/admin.php?medals/save"
  ["referrer"] => string(39) "https://pandorarp.com/admin.php?medals/"
  ["_GET"] => array(1) {
    ["medals/save"] => string(0) ""
  }
  ["_POST"] => array(6) {
    ["values"] => array(4) {
      ["name"] => string(23) "Crush and Burn [ 2019 ]"
      ["category_id"] => string(1) "1"
      ["description"] => string(47) "Participated in our 2019 run of Crush and Burn!"
      ["display_order"] => string(2) "10"
    }
    ["entity_id"] => string(0) ""
    ["_xfToken"] => string(8) "********"
    ["_xfRequestUri"] => string(18) "/admin.php?medals/"
    ["_xfWithData"] => string(1) "1"
    ["_xfResponseType"] => string(4) "json"
  }
}
So, the issue was that I was missing a column in the xf_bdmedal_medal table. I had the add-on installed in XenForo 1.5 with no issues. I'm guessing it became an issue during the upgrade to 2.1?

I was able to fix it by adding the missing column back in through phpmyadmin.

SQL:
ALTER TABLE `xf_bdmedal_medal` ADD `is_svg` TINYINT NOT NULL DEFAULT '0' AFTER `image_date`;
 

limboclub

Active member
Is there an issue with displaying medals for certain user groups?

I cannot find any permissions for medals apart from awarding, but many users and unregistered users cannot see medals in the user info box.
 

Brad Padgett

Well-known member
Hey I'm having a issue with medals not showing up on the award help page or on the profile where you sort them. They appear in the post bit but don't show up anywhere else.

This is a new occurrence as it was working just fine not too long ago. I plan to switch to addon flares add-on soon though but if you know what could be causing it let me know.
 

xfrocks

Well-known member
Hey I'm having a issue with medals not showing up on the award help page or on the profile where you sort them. They appear in the post bit but don't show up anywhere else.

This is a new occurrence as it was working just fine not too long ago. I plan to switch to addon flares add-on soon though but if you know what could be causing it let me know.
Did this happen out of nowhere or did you upgrade your XF2 installation or something?

Is it possible to have medals a member already has either faded or crossed out in the dialogue box to "Award medal"?
Should be possible but it may be a bit slow if you have lots of medals (or user already has many).
 

Brad Padgett

Well-known member
Did this happen out of nowhere or did you upgrade your XF2 installation or something?


Should be possible but it may be a bit slow if you have lots of medals (or user already has many).

Sorry for the late reply as my laptop had broken and I had to get a new one. Shortly after I posted that message they started showing again and must have been a caching issue possibly from cloudflare. I really appreciate your reply however. Would be nice if you did release a trophy extension as I may have to move to addonflare in a couple months to keep as many awards automatically given as possible.
 

LuckyRiver

Active member
@xfrocks, I asked for the other different add-on but no luck so I ask here for bd Medal
Any plan to provide REST API to award member?
eg. In poker game, a specific event is triggered, I like to give player a specific achievement with a medal and it will be reflected in his profile along with notification he just earns it.
 

Shane Greer

Active member
Hi not sure what has happened but there is an error now when the images are attached... any idea?

RuntimeException: Failed to prepare output files in src/addons/Xfrocks/Medal/Service/Medal/Image.php at line 150
  1. Xfrocks\Medal\Service\Medal\Image->updateImage() in src/addons/Xfrocks/Medal/Admin/Controller/Medal.php at line 136
  2. Xfrocks\Medal\Admin\Controller\Medal->Xfrocks\Medal\Admin\Controller\{closure}() in src/XF/Mvc/FormAction.php at line 197
  3. XF\Mvc\FormAction->run() in src/addons/Xfrocks/Medal/DevHelper/Admin/Controller/Entity.php at line 120
  4. Xfrocks\Medal\DevHelper\Admin\Controller\Entity->actionSave() in src/XF/Mvc/Dispatcher.php at line 350
  5. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 257
  6. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 113
  7. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 55
  8. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2337
  9. XF\App->run() in src/XF.php at line 488
  10. XF::runApp() in admin.php at line 13
 
Top