Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F101878072
20170410.calendar.01.repair.php
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Feb 14, 16:33
Size
1 KB
Mime Type
text/x-php
Expires
Sun, Feb 16, 16:33 (2 d)
Engine
blob
Format
Raw Data
Handle
24245706
Attached To
rPH Phabricator
20170410.calendar.01.repair.php
View Options
<?php
// See T12488. Some events survived "20161004.cal.01.noepoch.php" without
// having "utcInstanceEpoch" computed, which breaks ICS export. This appears
// to be the result of some bug which has been fixed in the meantime, so just
// redo this part of the migration.
$table
=
new
PhabricatorCalendarEvent
();
$conn
=
$table
->
establishConnection
(
'w'
);
$table_name
=
$table
->
getTableName
();
$viewer
=
PhabricatorUser
::
getOmnipotentUser
();
$all_events
=
id
(
new
PhabricatorCalendarEventQuery
())
->
setViewer
(
$viewer
)
->
execute
();
foreach
(
$all_events
as
$event
)
{
$id
=
$event
->
getID
();
if
(!
$event
->
getInstanceOfEventPHID
())
{
// Not a child event, so no instance epoch.
continue
;
}
if
(
$event
->
getUTCInstanceEpoch
())
{
// Already has an instance epoch.
continue
;
}
try
{
$event
->
updateUTCEpochs
();
}
catch
(
Exception
$ex
)
{
phlog
(
$ex
);
continue
;
}
queryfx
(
$conn
,
'UPDATE %T SET utcInstanceEpoch = %nd WHERE id = %d'
,
$table_name
,
$event
->
getUTCInstanceEpoch
(),
$id
);
}
Event Timeline
Log In to Comment