Custom renderer is ignored -- what do I need to look for?

22 views
Skip to first unread message

Kyle Banerjee

unread,
Jun 29, 2020, 1:16:40 PM6/29/20
to samvera-tech
We need custom renderers for a few attribute row fields. The ones we've written work fine on a staging server that was exactly the same as the production server a few months ago. However, when these changes are deployed verbatim to the production server, they appear to be ignored.

The _attribute_rows.html.erb file is definitely getting processed correctly -- changes made to it are reflected in the output screens. Likewise, the custom renderering files in hyrax/renderers also appear to be read -- doing something nonlegit like making a bogus class call causes an error.

However, the attribute_value_to_html sections don't appear to be read at all on the production machine -- no matter what I put, the only thing that gets returned are are the field contents and HTML wrapper. This occurs with all custom attributes on the production machine, but everything works great on the staging machine.

Any ideas of where to look greatly appreciated. Thanks,

kyle

Kyle Banerjee

unread,
Jun 29, 2020, 1:50:37 PM6/29/20
to samvera-tech
One thing I forgot to mention is that since it works fine on the staging machine, I tried moving the entire app directory to the production machine just in case I had something weird going on on prod.

When I did that, everything behaved as expected -- except the custom renderers were still ignored. This leads me to believe that whatever the problem is, it's not related either to the reference to the custom renderer or the renderer itself.

kyle

Tom Johnson

unread,
Jul 6, 2020, 9:36:19 AM7/6/20
to samvera-tech
Hi Kyle,

I wonder if you could say more (and/or link to) your setup for this?

Some of the behavior you describe is consistent with the possibility that there are Rails autoloading behaviors at play here, but it could also be something in your deployment process, so I'm a little uncertain about what to advise.


One thing you could do is wire in some debug logging there and see whether it helps you diagnose the issue.

Best,

Tom

Kyle Banerjee

unread,
Jul 6, 2020, 11:50:06 AM7/6/20
to samver...@googlegroups.com
Hi Tom,

I managed to solve the problem in the end -- or at least something I tried coincided with the problem going away.

What I did was delete all local files in hyrax/renderers which caused Samvera to revert to default behavior. Then I simply rebuilt these files, restarted apache, and everything started behaving nicely. 

I checked the logs when I was initially banging my head against the wall on this. However, I didn't see anything specific enough to guide me to a solution.

But we're golden now 😀 

kyle

--
You received this message because you are subscribed to a topic in the Google Groups "samvera-tech" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/samvera-tech/JZ2q2ZNe73s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to samvera-tech...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/samvera-tech/f14ad419-967e-4452-b97a-009700c525edn%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages