Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Problem/Motivation
The copyright year is hardcoded in the page footer template. This means it's not editable by site owners and admins.
See /templates/page/inc/page-footer.tpl.php
which contains...
<p class="copyright">Copyright © 2014 <?php echo check_plain(openaid2_get_setting('copyright', '')); ?></p>
Proposed resolution
Remove the the hardcoded string inside the p tag.
Add a helper function that automagically inserts the current year instead.
Update the theme settings to use the function too.
Remaining tasks
Tests may be needed?
Needs review.
User interface changes
Yes.
API changes
No.
Comment | File | Size | Author |
---|---|---|---|
#7 | 2483695-copyright-7.patch | 2.22 KB | cafuego |
#3 | openaid-copyright-date-themesetting.png | 10.25 KB | kattekrab |
#3 | openaid-copyright-date.png | 7.47 KB | kattekrab |
#2 | 2483695-copyright-1.patch | 1.82 KB | kattekrab |
Comments
Comment #1
kattekrab CreditAttribution: kattekrab commentedWith the help of @cafuego I've made a function that automatically uses the current year as a translateable string.
Removed the hardcoded bit from page-footer and updated the theme settings to use the function.
Comment #2
kattekrab CreditAttribution: kattekrab commentedoooops how about we attach the patch too?
Comment #3
kattekrab CreditAttribution: kattekrab at Creative Contingencies commentedComment #4
kattekrab CreditAttribution: kattekrab at Creative Contingencies commentedBreaks the admin theme.
Had to switch off adminimal and use openaid theme for admin too.
Comment #5
cedeweyThanks so much for the contribution! Feel free to reach out if you run into anything as you update the patch to work with the adminimal theme.
Thanks!
Clayton
Comment #6
cafuego CreditAttribution: cafuego commentedWe'll have a look and see if we can put the helper in theme-settings.php instead, it it'll be available in the admin theme then... just not sure if that file is then loaded by the openaid theme as well when rendering output.
Comment #7
cafuego CreditAttribution: cafuego commentedAttached patch adds a new file, helpers.inc, which is included by both the template.php and theme-settings.php file.
Comment #8
cedeweyWhen I try installing OpenAid with the applied patch I receive the following error
An AJAX HTTP error occurred. HTTP Result Code: 200 Debugging information follows. Path: http://openaid.dev/install.php?profile=openaid&locale=en&id=1&op=do StatusText: OK ResponseText: Home | Drupal @import url("http://openaid.dev/modules/system/system.theme.css?0"); @import url("http://openaid.dev/modules/system/system.menus.css?0"); @import url("http://openaid.dev/modules/system/system.messages.css?0"); @import url("http://openaid.dev/modules/system/system.base.css?0"); @import url("http://openaid.dev/modules/field/theme/field.css?0"); @import url("http://openaid.dev/modules/node/node.css?0"); @import url("http://openaid.dev/modules/search/search.css?0"); @import url("http://openaid.dev/modules/user/user.css?0"); @import url("http://openaid.dev/sites/all/modules/contrib/extlink/extlink.css?0"); @import url("http://openaid.dev/sites/all/modules/contrib/views/css/views.css?0"); @import url("http://openaid.dev/modules/system/system.admin.css?0"); @import url("http://openaid.dev/modules/system/system.maintenance.css?0"); @import url("http://openaid.dev/sites/all/modules/contrib/ctools/css/ctools.css?0"); @import url("http://openaid.dev/themes/seven/reset.css?0"); @import url("http://openaid.dev/themes/seven/style.css?0"); Home Installation tasksChoose profile(done)Choose language(done)Verify requirements(done)Set up database(done)Install profile(active)Configure siteFinished Installation Status message To use menu blocks, find the "Add menu block" link on the administer blocks page. SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'module' cannot be null
If I continue on with the site installation, the adminimal theme and openaid theme are both disabled.
Let me know if there is any additional info that I can provide which would be helpful.
Thanks!
Comment #9
cedeweyThe issue I was experiencing was coming from a different issue (https://www.drupal.org/node/2514108), not this patch. My bad!
I've tested this out again it works well. Thanks so much for the contribution kattekrab and cafuego. This improvement will be rolled into the next release.
Comment #11
kattekrab CreditAttribution: kattekrab at Creative Contingencies commentedW00t!
Thanks @cedewey :)
Comment #12
kattekrab CreditAttribution: kattekrab at Creative Contingencies commented