Skip to content

Commit 8993d9a

Browse files
committed
add no-op editFileMetadata() to FilePage to prevent errors #8305
As of Payara 6/JSF 4/Jakarta EE 10, this syntax doesn't work: action="#{bean[editFileAction]()}" (Or it logs errors in server.log at the very least.) So we switch to this syntax: action=#{bean.editFileMetadata()}" This means we have to make sure the method exists on all the beans, though, or we get errors. (It's unclear why we weren't seeing errors before!) So we add the method to FilePage, which gets passed as bean. We also remove the now unused "editFileAction".
1 parent 44874b3 commit 8993d9a

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

src/main/java/edu/harvard/iq/dataverse/FilePage.java

+9
Original file line numberDiff line numberDiff line change
@@ -1246,4 +1246,13 @@ public boolean isHasPublicStore() {
12461246
return settingsWrapper.isTrueForKey(SettingsServiceBean.Key.PublicInstall, StorageIO.isPublicStore(DataAccess.getStorageDriverFromIdentifier(file.getStorageIdentifier())));
12471247
}
12481248

1249+
/**
1250+
* This method only exists because in file-edit-button-fragment.xhtml we
1251+
* call bean.editFileMetadata() and we need both FilePage (this bean) and
1252+
* DatasetPage to have the method defined to prevent errors in server.log.
1253+
*/
1254+
public String editFileMetadata(){
1255+
return "";
1256+
}
1257+
12491258
}

src/main/webapp/file-edit-button-fragment.xhtml

+1-2
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525
configureTools - for single file, list of configureTools for the file
2626
bean - the named value of the backing bean for the below method(s), also used by isFilePg param
2727
unrestrictFileAction - name of the method on the above bean to call for unrestrict (method must take a boolean)
28-
editFileAction - for selected files, name of method on the above bean to send for edit metadata
2928
refreshTagsPopoupAction - for selected files, name of method on the above bean to refresh tags popup
3029
-->
3130
</ui:remove>
@@ -38,7 +37,7 @@
3837
<p:commandLink onclick="if (!(#{fileMetadata!=null} || testFilesSelected()))
3938
return false;"
4039
oncomplete="if(#{fileMetadata!=null}) window.location.assign('/editdatafiles.xhtml?selectedFileIds=#{fileMetadata.dataFile.id}&#38;datasetId=#{fileMetadata.datasetVersion.dataset.id}#{isFilePg?'&#38;referrer=FILE':''}&#38;version=#{fileMetadata.datasetVersion.version}')"
41-
action="#{bean[editFileAction]()}">
40+
action="#{bean.editFileMetadata()}">
4241
<h:outputText value="#{bundle['file.metadata']}"/>
4342
</p:commandLink>
4443
</li>

src/main/webapp/filesFragment.xhtml

-1
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,6 @@
421421
<ui:param name="fileMetadataForAction" value="#{DatasetPage.fileMetadataForAction}"/>
422422
<ui:param name="bean" value="#{DatasetPage}"/>
423423
<ui:param name="unrestrictFileAction" value="restrictFiles"/>
424-
<ui:param name="editFileAction" value="editFileMetadata"/>
425424
<ui:param name="refreshTagsPopoupAction" value="refreshTagsPopUp"/>
426425
</ui:include>
427426
</ul>

0 commit comments

Comments
 (0)