[TH] Covers [Deleted]

Getting error from Select preset for cover to None.

Code:
InvalidArgumentException: Attempted to convert NULL to integer [content_id] src/XF/Mvc/Entity/Entity.php:688

Generated by: Nirjonmela Jun 13, 2018 at 2:27 AM

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'content_id', 2, Array)
#1 src/XF/Mvc/Entity/Entity.php(1300): XF\Mvc\Entity\Entity->set('content_id', NULL, Array)
#2 src/XF/Mvc/Entity/Entity.php(1287): XF\Mvc\Entity\Entity->_resolveDeferredValue('content_id', Object(XF\Mvc\Entity\DeferredValue), 'save')
#3 src/XF/Mvc/Entity/Entity.php(1095): XF\Mvc\Entity\Entity->_fillDeferredValues('save')
#4 src/addons/ThemeHouse/Covers/Entity/Cover.php(337): XF\Mvc\Entity\Entity->save()
#5 src/XF/Mvc/Entity/Entity.php(1234): ThemeHouse\Covers\Entity\Cover->_preSave()
#6 src/XF/Mvc/Entity/Entity.php(1087): XF\Mvc\Entity\Entity->preSave()
#7 src/addons/ThemeHouse/Covers/Pub/Controller/Cover.php(322): XF\Mvc\Entity\Entity->save()
#8 src/XF/Mvc/Dispatcher.php(249): ThemeHouse\Covers\Pub\Controller\Cover->actionPreset(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('ThemeHouse\\Cove...', 'Preset', 'html', Object(XF\Mvc\ParameterBag), '', Object(ThemeHouse\Covers\Pub\Controller\Cover), NULL)
#10 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}

-------------

Previous InvalidArgumentException: Attempted to convert NULL to integer - src/XF/Mvc/Entity/ValueFormatter.php:115
#0 src/XF/Mvc/Entity/Entity.php(684): XF\Mvc\Entity\ValueFormatter->castValueToType(NULL, 2, Array)
#1 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'content_id', 2, Array)
#2 src/XF/Mvc/Entity/Entity.php(1300): XF\Mvc\Entity\Entity->set('content_id', NULL, Array)
#3 src/XF/Mvc/Entity/Entity.php(1287): XF\Mvc\Entity\Entity->_resolveDeferredValue('content_id', Object(XF\Mvc\Entity\DeferredValue), 'save')
#4 src/XF/Mvc/Entity/Entity.php(1095): XF\Mvc\Entity\Entity->_fillDeferredValues('save')
#5 src/addons/ThemeHouse/Covers/Entity/Cover.php(337): XF\Mvc\Entity\Entity->save()
#6 src/XF/Mvc/Entity/Entity.php(1234): ThemeHouse\Covers\Entity\Cover->_preSave()
#7 src/XF/Mvc/Entity/Entity.php(1087): XF\Mvc\Entity\Entity->preSave()
#8 src/addons/ThemeHouse/Covers/Pub/Controller/Cover.php(322): XF\Mvc\Entity\Entity->save()
#9 src/XF/Mvc/Dispatcher.php(249): ThemeHouse\Covers\Pub\Controller\Cover->actionPreset(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('ThemeHouse\\Cove...', 'Preset', 'html', Object(XF\Mvc\ParameterBag), '', Object(ThemeHouse\Covers\Pub\Controller\Cover), NULL)
#11 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#13 src/XF.php(328): XF\App->run()
#14 index.php(13): XF::runApp('XF\\Pub\\App')
#15 {main}

Request state

array(4) {
  ["url"] => string(87) "/covers/user/1/preset?cover_preset_id=0&t=1528835268%2Ce88df049efaa52bb650b9ccd80489e28"
  ["referrer"] => string(44) "/members/nirjonmela.1/"
  ["_GET"] => array(2) {
    ["cover_preset_id"] => string(1) "0"
    ["t"] => string(43) "1528835268,e88df049efaa52bb650b9ccd80489e28"
  }
  ["_POST"] => array(0) {
  }
}
 
Getting error from Select preset for cover to None.

Code:
InvalidArgumentException: Attempted to convert NULL to integer [content_id] src/XF/Mvc/Entity/Entity.php:688

Generated by: Nirjonmela Jun 13, 2018 at 2:27 AM

Stack trace

#0 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'content_id', 2, Array)
#1 src/XF/Mvc/Entity/Entity.php(1300): XF\Mvc\Entity\Entity->set('content_id', NULL, Array)
#2 src/XF/Mvc/Entity/Entity.php(1287): XF\Mvc\Entity\Entity->_resolveDeferredValue('content_id', Object(XF\Mvc\Entity\DeferredValue), 'save')
#3 src/XF/Mvc/Entity/Entity.php(1095): XF\Mvc\Entity\Entity->_fillDeferredValues('save')
#4 src/addons/ThemeHouse/Covers/Entity/Cover.php(337): XF\Mvc\Entity\Entity->save()
#5 src/XF/Mvc/Entity/Entity.php(1234): ThemeHouse\Covers\Entity\Cover->_preSave()
#6 src/XF/Mvc/Entity/Entity.php(1087): XF\Mvc\Entity\Entity->preSave()
#7 src/addons/ThemeHouse/Covers/Pub/Controller/Cover.php(322): XF\Mvc\Entity\Entity->save()
#8 src/XF/Mvc/Dispatcher.php(249): ThemeHouse\Covers\Pub\Controller\Cover->actionPreset(Object(XF\Mvc\ParameterBag))
#9 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('ThemeHouse\\Cove...', 'Preset', 'html', Object(XF\Mvc\ParameterBag), '', Object(ThemeHouse\Covers\Pub\Controller\Cover), NULL)
#10 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#11 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#12 src/XF.php(328): XF\App->run()
#13 index.php(13): XF::runApp('XF\\Pub\\App')
#14 {main}

-------------

Previous InvalidArgumentException: Attempted to convert NULL to integer - src/XF/Mvc/Entity/ValueFormatter.php:115
#0 src/XF/Mvc/Entity/Entity.php(684): XF\Mvc\Entity\ValueFormatter->castValueToType(NULL, 2, Array)
#1 src/XF/Mvc/Entity/Entity.php(575): XF\Mvc\Entity\Entity->_castValueToType(NULL, 'content_id', 2, Array)
#2 src/XF/Mvc/Entity/Entity.php(1300): XF\Mvc\Entity\Entity->set('content_id', NULL, Array)
#3 src/XF/Mvc/Entity/Entity.php(1287): XF\Mvc\Entity\Entity->_resolveDeferredValue('content_id', Object(XF\Mvc\Entity\DeferredValue), 'save')
#4 src/XF/Mvc/Entity/Entity.php(1095): XF\Mvc\Entity\Entity->_fillDeferredValues('save')
#5 src/addons/ThemeHouse/Covers/Entity/Cover.php(337): XF\Mvc\Entity\Entity->save()
#6 src/XF/Mvc/Entity/Entity.php(1234): ThemeHouse\Covers\Entity\Cover->_preSave()
#7 src/XF/Mvc/Entity/Entity.php(1087): XF\Mvc\Entity\Entity->preSave()
#8 src/addons/ThemeHouse/Covers/Pub/Controller/Cover.php(322): XF\Mvc\Entity\Entity->save()
#9 src/XF/Mvc/Dispatcher.php(249): ThemeHouse\Covers\Pub\Controller\Cover->actionPreset(Object(XF\Mvc\ParameterBag))
#10 src/XF/Mvc/Dispatcher.php(88): XF\Mvc\Dispatcher->dispatchClass('ThemeHouse\\Cove...', 'Preset', 'html', Object(XF\Mvc\ParameterBag), '', Object(ThemeHouse\Covers\Pub\Controller\Cover), NULL)
#11 src/XF/Mvc/Dispatcher.php(41): XF\Mvc\Dispatcher->dispatchLoop(Object(XF\Mvc\RouteMatch))
#12 src/XF/App.php(1931): XF\Mvc\Dispatcher->run()
#13 src/XF.php(328): XF\App->run()
#14 index.php(13): XF::runApp('XF\\Pub\\App')
#15 {main}

Request state

array(4) {
  ["url"] => string(87) "/covers/user/1/preset?cover_preset_id=0&t=1528835268%2Ce88df049efaa52bb650b9ccd80489e28"
  ["referrer"] => string(44) "/members/nirjonmela.1/"
  ["_GET"] => array(2) {
    ["cover_preset_id"] => string(1) "0"
    ["t"] => string(43) "1528835268,e88df049efaa52bb650b9ccd80489e28"
  }
  ["_POST"] => array(0) {
  }
}
I'm not able to get this same error when I set the style preset too none.
 
Also why does

.p-body-header .cover .cover-thread add 130px of padding to the top on threads without covers? Makes non cover threads look rather spacious to say the least. You might want to put a conditional in there to put that space if there's an actual thread cover image.

Or is the above needed for the new Nodes release as I just installed it and realised the drastic changes there.

Feature suggestions:
Put a hard limit on upload cover image file size. I can see this getting out of hand with some members who won't right-size their images.
Put a hard limit on cover image size (max width/height).
 
Last edited:
Nice to see this available for XF2 - it's a good start but parts of it need refined.

Covers for forum view and thread view are great but like @ichpen said above the 130px at the top of threads with no covers is a waste of space and there needs to be an option to select which forums use covers. Also the ability to upload your own covers for forum view should be an option as well as an option to switch off completely. I've disabled the template modifications for forum/thread view because it is unusable in it's present form on my site - I realise some of the above may have to do with some of my own customization though.

For member tooltip I feel that this would be a better outcome.

membertooltip.webp

Having the cover over the username/title/blurb can make it difficult to read if you're using an image as your cover. I didn't try the visitor menu as I don't see the point of having a cover there as only yourself will see it, but I assume the outcome will be the same as the member tooltip.

I did like the member view covers though. I just changed the layout around a little to suit my needs.

memberview.webp

Again, thanks for releasing. I look forward to seeing how the development grows :)
 
Also keep in mind it appears modifying covers is tied to your edit post permission meaning if you can't edit your own post you won't see the edit cover option. I assume that was intentional.
 
Nice to see this available for XF2 - it's a good start but parts of it need refined.

Covers for forum view and thread view are great but like @ichpen said above the 130px at the top of threads with no covers is a waste of space and there needs to be an option to select which forums use covers. Also the ability to upload your own covers for forum view should be an option as well as an option to switch off completely. I've disabled the template modifications for forum/thread view because it is unusable in it's present form on my site - I realise some of the above may have to do with some of my own customization though.

For member tooltip I feel that this would be a better outcome.

View attachment 177838

Having the cover over the username/title/blurb can make it difficult to read if you're using an image as your cover. I didn't try the visitor menu as I don't see the point of having a cover there as only yourself will see it, but I assume the outcome will be the same as the member tooltip.

I did like the member view covers though. I just changed the layout around a little to suit my needs.

View attachment 177839

Again, thanks for releasing. I look forward to seeing how the development grows :)

Echoing the remarks here, the forum/thread covers inheriting the node images is fine as a default option but needs some refinement and ability to set this on a per node basis. The node image dimensions are very specific and render poorly when stretched out to fill that cover container (on forums/threads) especially on extra wide layouts. Having an edit forum cover option at a minimum would be good then thread covers can at least inherit the custom forum cover image (as opposed to node list image).
 
It's on UIX 2, it shows up on first upload only. Rather weird.
This is now resolved, thank you for your report! :)
Also why does

.p-body-header .cover .cover-thread add 130px of padding to the top on threads without covers? Makes non cover threads look rather spacious to say the least. You might want to put a conditional in there to put that space if there's an actual thread cover image.

Or is the above needed for the new Nodes release as I just installed it and realised the drastic changes there.

Feature suggestions:
Put a hard limit on upload cover image file size. I can see this getting out of hand with some members who won't right-size their images.
Put a hard limit on cover image size (max width/height).
Thank you for these suggestions and improvements for Covers, I'm gonna go ahead and add these to our issue tracker.
Nice to see this available for XF2 - it's a good start but parts of it need refined.

Covers for forum view and thread view are great but like @ichpen said above the 130px at the top of threads with no covers is a waste of space and there needs to be an option to select which forums use covers. Also the ability to upload your own covers for forum view should be an option as well as an option to switch off completely. I've disabled the template modifications for forum/thread view because it is unusable in it's present form on my site - I realise some of the above may have to do with some of my own customization though.

For member tooltip I feel that this would be a better outcome.

View attachment 177838

Having the cover over the username/title/blurb can make it difficult to read if you're using an image as your cover. I didn't try the visitor menu as I don't see the point of having a cover there as only yourself will see it, but I assume the outcome will be the same as the member tooltip.

I did like the member view covers though. I just changed the layout around a little to suit my needs.

View attachment 177839

Again, thanks for releasing. I look forward to seeing how the development grows :)
Thank you for these feature suggestions Gemma and nice edits to I must say! :)
Also keep in mind it appears modifying covers is tied to your edit post permission meaning if you can't edit your own post you won't see the edit cover option. I assume that was intentional.
If I'm not mistaken I believe it was intentional, yes. But I am gonna double check with one of our developers to be sure.
 
Actually, I've had a little play around with forum and thread covers again and I must have had something set-up wrong as it looks much better than I initially thought.

Untitled-1.webp Untitled-2.webp

Apologies, I've been away from forums for a month :)
 
Is there a demo-site anywhere?
I wonder if the image cover is responsive...
And how an image is inserted... as an image or as a background-image?
 
Back
Top Bottom