#2054 prevent spreadsheet export and invoice from breaking

Merged Kevin Papst kevinpapst
Coverage Reach
Repository/TimesheetRepository.php Repository/Query/TimesheetQuery.php Repository/Query/BaseQuery.php Repository/Query/BaseFormTypeQuery.php Repository/Query/ActivityQuery.php Repository/Query/ProjectQuery.php Repository/Query/ActivityFormTypeQuery.php Repository/Query/ProjectFormTypeQuery.php Repository/Query/TeamQuery.php Repository/Query/InvoiceQuery.php Repository/Query/VisibilityTrait.php Repository/Query/BillableTrait.php Repository/Query/ExportQuery.php Repository/Query/CustomerFormTypeQuery.php Repository/Query/UserQuery.php Repository/Query/UserFormTypeQuery.php Repository/Query/TagQuery.php Repository/Query/CustomerQuery.php Repository/Loader/TimesheetIdLoader.php Repository/Loader/ActivityIdLoader.php Repository/Loader/UserIdLoader.php Repository/Loader/ProjectIdLoader.php Repository/Loader/CustomerIdLoader.php Repository/Loader/InvoiceIdLoader.php Repository/Loader/TeamIdLoader.php Repository/Loader/UserLoader.php Repository/Loader/ProjectLoader.php Repository/Loader/TimesheetLoader.php Repository/Loader/InvoiceLoader.php Repository/Loader/CustomerLoader.php Repository/Loader/ActivityLoader.php Repository/Loader/TeamLoader.php Repository/Loader/DefaultLoader.php Repository/ProjectRepository.php Repository/ActivityRepository.php Repository/CustomerRepository.php Repository/UserRepository.php Repository/InvoiceRepository.php Repository/TeamRepository.php Repository/TagRepository.php Repository/InvoiceDocumentRepository.php Repository/ConfigurationRepository.php Repository/WidgetRepository.php Repository/Paginator/LoaderPaginator.php Repository/Paginator/QueryBuilderPaginator.php Repository/InvoiceTemplateRepository.php Repository/CustomerRateRepository.php Repository/ProjectRateRepository.php Repository/ActivityRateRepository.php Repository/RoleRepository.php Repository/RolePermissionRepository.php Repository/TimesheetInvoiceItemRepository.php Controller/SystemConfigurationController.php Controller/TimesheetAbstractController.php Controller/ProjectController.php Controller/CustomerController.php Controller/ActivityController.php Controller/InvoiceController.php Controller/ProfileController.php Controller/ReportingController.php Controller/PermissionController.php Controller/DoctorController.php Controller/TeamController.php Controller/UserController.php Controller/TimesheetTeamController.php Controller/TagController.php Controller/ExportController.php Controller/CalendarController.php Controller/DashboardController.php Controller/AbstractController.php Controller/HomepageController.php Controller/AboutController.php Controller/TimesheetController.php Controller/PluginController.php Controller/LayoutController.php Controller/WidgetController.php Form/Type/DateRangeType.php Form/Type/ProjectType.php Form/Type/CustomerType.php Form/Type/UserPreferenceType.php Form/Type/InvoiceRendererType.php Form/Type/DateTimePickerType.php Form/Type/ActivityType.php Form/Type/SystemConfigurationType.php Form/Type/TeamMemberType.php Form/Type/EntityMetaDefinitionType.php Form/Type/DatePickerType.php Form/Type/MonthPickerType.php Form/Type/UserType.php Form/Type/WeekPickerType.php Form/Type/TagsInputType.php Form/Type/TeamType.php Form/Type/ColorPickerType.php Form/Type/InvoiceCalculatorType.php Form/Type/UserRoleType.php Form/Type/InvoiceNumberGeneratorType.php Form/Type/LanguageType.php Form/Type/InitialViewType.php Form/Type/TagsSelectType.php Form/Type/TrackingModeType.php Form/Type/WeekDaysType.php Form/Type/RoundingModeType.php Form/Type/APIDateTimeType.php Form/Type/CalendarViewType.php Form/Type/FirstWeekDayType.php Form/Type/DurationType.php Form/Type/SearchTermType.php Form/Type/InvoiceTemplateType.php Form/Type/MailType.php Form/Type/TagsType.php Form/Type/HourlyRateType.php Form/Type/FixedRateType.php Form/Type/PageSizeType.php Form/Type/EnhancedSelectboxType.php Form/Type/YesNoType.php Form/Type/DayTimeType.php Form/Type/ThemeLayoutType.php Form/Type/BillableType.php Form/Type/SkinType.php Form/Type/VisibilityType.php Form/Type/AvatarType.php Form/Type/MetaFieldsCollectionType.php Form/Type/DateTimeTextType.php Form/Toolbar/AbstractToolbarForm.php Form/Toolbar/TimesheetToolbarForm.php Form/Toolbar/ExportToolbarForm.php Form/Toolbar/InvoiceToolbarSimpleForm.php Form/Toolbar/ActivityToolbarForm.php Form/Toolbar/InvoiceToolbarForm.php Form/Toolbar/UserToolbarForm.php Form/Toolbar/ProjectToolbarForm.php Form/Toolbar/CustomerToolbarForm.php Form/Toolbar/TeamToolbarForm.php Form/Toolbar/TagToolbarForm.php Form/Toolbar/BillableType.php Form/MultiUpdate/TimesheetMultiUpdate.php Form/MultiUpdate/TimesheetMultiUpdateDTO.php Form/MultiUpdate/MultiUpdateTable.php Form/MultiUpdate/MultiUpdateTableDTO.php Form/TimesheetEditForm.php Form/Model/Configuration.php Form/Model/MultiUserTimesheet.php Form/Model/SystemConfiguration.php Form/Model/DateRange.php Form/API/TimesheetApiEditForm.php Form/API/UserApiCreateForm.php Form/API/UserApiEditForm.php Form/API/CustomerApiEditForm.php Form/API/ActivityApiEditForm.php Form/API/ProjectApiEditForm.php Form/API/TeamApiEditForm.php Form/API/CustomerRateApiForm.php Form/API/ProjectRateApiForm.php Form/API/ActivityRateApiForm.php Form/API/TagApiEditForm.php Form/Extension/SelectWithApiDataExtension.php Form/Extension/EnhancedChoiceTypeExtension.php Form/Extension/DocumentationLinkExtension.php Form/Extension/UserExtension.php Form/Extension/IconExtension.php Form/FormTrait.php Form/ActivityEditForm.php Form/DataTransformer/DurationStringToSecondsTransformer.php Form/DataTransformer/TagArrayToStringTransformer.php Form/DataTransformer/SearchTermTransformer.php Form/CustomerEditForm.php Form/ProjectEditForm.php Form/InvoiceTemplateForm.php Form/InvoiceDocumentUploadForm.php Form/UserEditType.php Form/RoleType.php Form/EntityFormTrait.php Form/AbstractRateForm.php Form/TeamEditForm.php Form/UserCreateType.php Form/TimesheetMultiUserEditForm.php Form/ActivityRateForm.php Form/CustomerRateForm.php Form/ProjectRateForm.php Form/TagEditForm.php Form/TimesheetAdminEditForm.php Form/UserApiTokenType.php Form/ProjectTeamPermissionForm.php Form/UserPasswordType.php Form/UserPreferencesForm.php Form/TeamCustomerForm.php Form/CustomerCommentForm.php Form/SystemConfigurationForm.php Form/UserTeamsType.php Form/ActivityTeamPermissionForm.php Form/UserRolesType.php Form/ProjectCommentForm.php Form/CustomerTeamPermissionForm.php Form/TeamProjectForm.php Entity/Timesheet.php Entity/User.php Entity/Customer.php Entity/Project.php Entity/InvoiceTemplate.php Entity/Team.php Entity/Activity.php Entity/MetaTableTypeTrait.php Entity/Invoice.php Entity/UserPreference.php Entity/Rate.php Entity/Tag.php Entity/CommentTableTypeTrait.php Entity/RolePermission.php Entity/InvoiceDocument.php Entity/Configuration.php Entity/ColorTrait.php Entity/ProjectMeta.php Entity/TimesheetMeta.php Entity/ActivityMeta.php Entity/CustomerMeta.php Entity/ActivityRate.php Entity/CustomerRate.php Entity/Role.php Entity/ProjectRate.php Entity/CustomerComment.php Entity/ProjectComment.php Invoice/Renderer/AbstractSpreadsheetRenderer.php Invoice/Renderer/DocxRenderer.php Invoice/Renderer/AbstractTwigRenderer.php Invoice/Renderer/AdvancedValueBinder.php Invoice/Renderer/PdfRenderer.php Invoice/Renderer/AbstractRenderer.php Invoice/Renderer/XlsxRenderer.php Invoice/Renderer/OdsRenderer.php Invoice/Renderer/RendererTrait.php Invoice/Renderer/TextRenderer.php Invoice/Renderer/XmlRenderer.php Invoice/Renderer/JsonRenderer.php Invoice/Renderer/TwigRenderer.php Invoice/Hydrator/InvoiceItemDefaultHydrator.php Invoice/Hydrator/InvoiceModelDefaultHydrator.php Invoice/Hydrator/InvoiceModelProjectHydrator.php Invoice/Hydrator/InvoiceModelCustomerHydrator.php Invoice/Hydrator/InvoiceModelActivityHydrator.php Invoice/Hydrator/InvoiceModelUserHydrator.php Invoice/ServiceInvoice.php Invoice/Calculator/AbstractMergedCalculator.php Invoice/Calculator/AbstractCalculator.php Invoice/Calculator/AbstractSumInvoiceCalculator.php Invoice/Calculator/ShortInvoiceCalculator.php Invoice/Calculator/DefaultCalculator.php Invoice/Calculator/ActivityInvoiceCalculator.php Invoice/Calculator/ProjectInvoiceCalculator.php Invoice/Calculator/UserInvoiceCalculator.php Invoice/Calculator/DateInvoiceCalculator.php Invoice/Calculator/WeeklyInvoiceCalculator.php Invoice/NumberGenerator/ConfigurableNumberGenerator.php Invoice/NumberGenerator/DateNumberGenerator.php Invoice/InvoiceModel.php Invoice/InvoiceItem.php Invoice/InvoiceFilename.php Invoice/DefaultInvoiceFormatter.php API/TimesheetController.php API/TeamController.php API/ProjectController.php API/ActivityController.php API/CustomerController.php API/UserController.php API/Model/I18nConfig.php API/Model/TimesheetConfig.php API/ConfigurationController.php API/TagController.php API/Serializer/ValidationFailedExceptionErrorHandler.php API/StatusController.php API/BaseApiController.php API/NotFoundException.php DependencyInjection/Configuration.php DependencyInjection/AppExtension.php DependencyInjection/Compiler/DoctrineCompilerPass.php DependencyInjection/Compiler/ExportServiceCompilerPass.php DependencyInjection/Compiler/TwigContextCompilerPass.php DependencyInjection/Compiler/InvoiceServiceCompilerPass.php DependencyInjection/Compiler/WidgetCompilerPass.php Export/Base/AbstractSpreadsheetRenderer.php Export/Base/RendererTrait.php Export/Base/HtmlRenderer.php Export/Base/PDFRenderer.php Export/Base/XlsxRenderer.php Export/Base/CsvRenderer.php Export/Spreadsheet/Extractor/AnnotationExtractor.php Export/Spreadsheet/Extractor/MetaFieldExtractor.php Export/Spreadsheet/Extractor/UserPreferenceExtractor.php Export/Spreadsheet/CellFormatter/DateTimeFormatter.php Export/Spreadsheet/CellFormatter/TimeFormatter.php Export/Spreadsheet/CellFormatter/DateFormatter.php Export/Spreadsheet/CellFormatter/ArrayFormatter.php Export/Spreadsheet/CellFormatter/BooleanFormatter.php Export/Spreadsheet/CellFormatter/DurationFormatter.php Export/Spreadsheet/Writer/XlsxWriter.php Export/Spreadsheet/Writer/BinaryFileResponseWriter.php Export/Spreadsheet/SpreadsheetExporter.php Export/Spreadsheet/ColumnDefinition.php Export/Spreadsheet/UserExporter.php Export/Spreadsheet/EntityWithMetaFieldsExporter.php Export/Spreadsheet/AnnotatedObjectExporter.php Export/Renderer/PdfRendererFactory.php Export/Renderer/HtmlRendererFactory.php Export/Renderer/XlsxRenderer.php Export/Renderer/HtmlRenderer.php Export/Renderer/CsvRenderer.php Export/Renderer/PDFRenderer.php Export/Timesheet/HtmlRenderer.php Export/ServiceExport.php Export/Annotation/Expose.php Export/Annotation/Order.php Command/InvoiceCreateCommand.php Command/ImportProjectCommand.php Command/ImportCustomerCommand.php Command/CreateUserCommand.php Command/InstallCommand.php Command/AbstractBundleInstallerCommand.php Command/UpdateCommand.php Command/PluginCommand.php Command/VersionCommand.php Timesheet/Rounding/ClosestRounding.php Timesheet/Rounding/DefaultRounding.php Timesheet/Rounding/CeilRounding.php Timesheet/Rounding/FloorRounding.php Timesheet/TrackingMode/AbstractTrackingMode.php Timesheet/TrackingMode/DefaultMode.php Timesheet/TrackingMode/DurationFixedBeginMode.php Timesheet/TrackingMode/DurationOnlyMode.php Timesheet/TrackingMode/PunchInOutMode.php Timesheet/TimesheetService.php Timesheet/Calculator/RateCalculator.php Timesheet/Calculator/DurationCalculator.php Timesheet/RoundingService.php Timesheet/DateTimeFactory.php Timesheet/UserDateTimeFactory.php Timesheet/TrackingModeService.php Timesheet/Util.php Utils/LocaleFormatter.php Utils/Duration.php Utils/Color.php Utils/LocaleHelper.php Utils/ParsedownExtension.php Utils/SearchTerm.php Utils/AvatarService.php Utils/Translator.php Utils/LocaleFormats.php Utils/FileHelper.php Utils/MPdfConverter.php Utils/MenuItemModel.php Utils/Markdown.php Utils/StringHelper.php Utils/LocaleSettings.php Utils/MomentFormatConverter.php Importer/DefaultCustomerImporter.php Importer/GrandtotalCustomerImporter.php Importer/AbstractProjectImporter.php Importer/DefaultProjectImporter.php Importer/AbstractCustomerImporter.php Importer/ImporterService.php Importer/CsvReader.php Importer/UnknownUserException.php Importer/InvalidFieldsException.php Importer/UnsupportedFormatException.php EventSubscriber/UserPreferenceSubscriber.php EventSubscriber/MenuSubscriber.php EventSubscriber/DashboardSubscriber.php EventSubscriber/MenuBuilderSubscriber.php EventSubscriber/ThemeOptionsSubscriber.php EventSubscriber/RedirectToLocaleSubscriber.php EventSubscriber/UserProfileSubscriber.php EventSubscriber/RegistrationSubscriber.php EventSubscriber/UserEnvironmentSubscriber.php EventSubscriber/AjaxAuthenticationSubscriber.php EventSubscriber/ResetPasswordSubscriber.php Validator/Constraints/TimesheetValidator.php Validator/Constraints/TimesheetMultiUpdateValidator.php Validator/Constraints/TimesheetLockdownValidator.php Validator/Constraints/TimesheetRestartValidator.php Validator/Constraints/TimesheetOverlappingValidator.php Validator/Constraints/TimesheetFutureTimesValidator.php Validator/Constraints/TimesheetMultiUserValidator.php Validator/Constraints/RoleValidator.php Validator/Constraints/TimeFormatValidator.php Validator/Constraints/ProjectValidator.php Validator/Constraints/DateTimeFormatValidator.php Validator/Constraints/Duration.php Validator/Constraints/TimesheetMultiUser.php Validator/Constraints/TimesheetLockdown.php Validator/Constraints/TimesheetOverlapping.php Validator/Constraints/Timesheet.php Validator/Constraints/DateTimeFormat.php Validator/Constraints/TimesheetFutureTimes.php Validator/Constraints/Project.php Validator/Constraints/TimesheetRestart.php Validator/Constraints/TimesheetMultiUpdate.php Validator/Constraints/TimeFormat.php Validator/ValidationFailedException.php Validator/ValidationException.php Twig/DateExtensions.php Twig/Extensions.php Twig/DatatableExtensions.php Twig/LocaleExtensions.php Twig/PaginationExtension.php Twig/MarkdownExtension.php Twig/EncoreExtension.php Twig/ReportingExtension.php Twig/WidgetExtension.php Twig/AvatarExtension.php Twig/TimesheetExtension.php Twig/TitleExtension.php Twig/Runtime/ThemeEventExtension.php Twig/ConfigExtension.php Twig/IconExtension.php Twig/EventExtensions.php Ldap/LdapUserHydrator.php Ldap/LdapManager.php Ldap/LdapDriver.php Ldap/LdapUserProvider.php Ldap/LdapAuthenticationProvider.php Ldap/FormLoginLdapFactory.php Ldap/SanitizingException.php Ldap/LdapDriverException.php Widget/Type/PaginatedWorkingTimeChart.php Widget/Type/DailyWorkingTimeChart.php Widget/Type/SimpleStatisticChart.php Widget/Type/UserTeamProjects.php Widget/Type/AbstractWidgetType.php Widget/Type/AbstractContainer.php Widget/Type/UserTeams.php Widget/Type/SimpleWidget.php Widget/Type/Counter.php Widget/Type/More.php Widget/Renderer/SimpleWidgetRenderer.php Widget/Renderer/CompoundChartRenderer.php Widget/Renderer/CompoundRowRenderer.php Widget/Renderer/AbstractTwigRenderer.php Widget/WidgetService.php Configuration/StringAccessibleConfigTrait.php Configuration/SystemConfiguration.php Configuration/TimesheetConfiguration.php Configuration/LanguageFormattings.php Configuration/CalendarConfiguration.php Configuration/FormConfiguration.php Configuration/ThemeConfiguration.php Configuration/LdapConfiguration.php Configuration/MailConfiguration.php Event/PermissionsEvent.php Event/UserPreferenceEvent.php Event/ThemeEvent.php Event/ConfigureMainMenuEvent.php Event/InvoicePostRenderEvent.php Event/AbstractMetaDisplayEvent.php Event/InvoicePreRenderEvent.php Event/DashboardEvent.php Event/ReportingEvent.php Event/CalendarGoogleSourceEvent.php Event/CalendarDragAndDropSourceEvent.php Event/UserPreferenceDisplayEvent.php Event/SystemConfigurationEvent.php Event/TimesheetRestartPreEvent.php Event/TimesheetRestartPostEvent.php Event/PermissionSectionsEvent.php Event/TimesheetMetaDefinitionEvent.php Event/AbstractTimesheetMultipleEvent.php Event/ProjectMetaDefinitionEvent.php Event/AbstractCustomerEvent.php Event/AbstractProjectEvent.php Event/AbstractTimesheetEvent.php Event/InvoiceCreatedEvent.php Event/CustomerMetaDefinitionEvent.php Event/ActivityMetaDefinitionEvent.php Event/PrepareUserEvent.php Event/ProjectMetaDisplayEvent.php Event/ActivityMetaDisplayEvent.php Event/TimesheetMetaDisplayEvent.php Event/CustomerMetaDisplayEvent.php Voter/TimesheetVoter.php Voter/ActivityVoter.php Voter/ProjectVoter.php Voter/CustomerVoter.php Voter/UserVoter.php Voter/AbstractVoter.php Voter/TeamVoter.php Voter/RolePermissionVoter.php Saml/User/SamlUserFactory.php Saml/Security/SamlFactory.php Saml/Security/SamlAuthenticationSuccessHandler.php Saml/Controller/SamlController.php Saml/Provider/SamlProvider.php Saml/Logout/SamlLogoutHandler.php Saml/SamlTokenFactory.php Saml/SamlAuth.php Security/TokenAuthenticator.php Security/RolePermissionManager.php Security/RoleService.php Security/DoctrineUserProvider.php Security/UserChecker.php Security/CurrentUser.php Security/SessionHandler.php Security/AclDecisionManager.php Model/Statistic/Day.php Model/Statistic/Month.php Model/Statistic/Year.php Model/TimesheetStatistic.php Model/TimesheetCountedStatistic.php Model/CustomerStatistic.php Model/ProjectStatistic.php Model/PermissionSection.php Kernel.php Plugin/PluginManager.php Plugin/PluginMetadata.php Plugin/Plugin.php Plugin/AbstractPluginExtension.php Reporting/WeekByUserForm.php Reporting/MonthByUserForm.php Reporting/MonthlyUserListForm.php Reporting/DateByUser.php Reporting/Report.php Reporting/MonthlyUserList.php Project/ProjectDuplicationService.php Project/ProjectService.php Calendar/TimesheetEntry.php Calendar/RecentActivitiesSource.php Calendar/GoogleSource.php Calendar/Google.php Doctrine/TimesheetSubscriber.php Doctrine/UTCDateTimeType.php Doctrine/SqliteSessionInitSubscriber.php Mail/UserMails.php Mail/KimaiMailer.php Customer/CustomerService.php

No flags found

Use flags to group coverage reports by test type, project and/or folders.
Then setup custom commit statuses and notifications for each flag.

e.g., #unittest #integration

#production #enterprise

#frontend #backend

Learn more about Codecov Flags here.


@@ -21,6 +21,7 @@
Loading
21 21
use App\Repository\Query\TimesheetQuery;
22 22
use App\Twig\DateExtensions;
23 23
use DateTime;
24 +
use PhpOffice\PhpSpreadsheet\Cell\DataType;
24 25
use PhpOffice\PhpSpreadsheet\Shared\Date;
25 26
use PhpOffice\PhpSpreadsheet\Spreadsheet;
26 27
use PhpOffice\PhpSpreadsheet\Style\Border;
@@ -312,7 +313,7 @@
Loading
312 313
            $columns['description']['render'] = function (Worksheet $sheet, int $row, int $column, ExportItemInterface $entity) use (&$isColumnFormatted, $maxWidth, $wrapText) {
313 314
                $cell = $sheet->getCellByColumnAndRow($column, $row);
314 315
315 -
                $cell->setValue($entity->getDescription());
316 +
                $cell->setValueExplicit($entity->getDescription(), DataType::TYPE_STRING);
316 317
317 318
                // Apply wrap text if configured
318 319
                if ($wrapText) {

@@ -12,6 +12,7 @@
Loading
12 12
use App\Entity\InvoiceDocument;
13 13
use App\Invoice\InvoiceModel;
14 14
use PhpOffice\PhpSpreadsheet\Cell\Cell;
15 +
use PhpOffice\PhpSpreadsheet\Cell\DataType;
15 16
use PhpOffice\PhpSpreadsheet\IOFactory;
16 17
use PhpOffice\PhpSpreadsheet\Spreadsheet;
17 18
use PhpOffice\PhpSpreadsheet\Worksheet\Worksheet;
@@ -93,7 +94,11 @@
Loading
93 94
                    $value = str_replace($searchKey, $content, $value);
94 95
                }
95 96
96 -
                $cell->setValue($value);
97 +
                if (\is_string($value)) {
98 +
                    $cell->setValueExplicit($value, DataType::TYPE_STRING);
99 +
                } else {
100 +
                    $cell->setValue($value);
101 +
                }
97 102
            }
98 103
99 104
            if ($sheetValues !== false && $entryRow < $invoiceItemCount - 1) {

Learn more Showing 2 files with coverage changes found.

Changes in src/Invoice/Renderer/AdvancedValueBinder.php
-8
+8
Loading file...
Changes in src/Repository/TimesheetRepository.php
-1
+1
Loading file...
Files Complexity Coverage
src ø -0.06% 93.27%
Project Totals (530 files) 5788 93.27%
Loading